@@ -61,17 +61,17 @@ func List(ctx *context.Context) {
61
61
62
62
var workflows []Workflow
63
63
if empty , err := ctx .Repo .GitRepo .IsEmpty (); err != nil {
64
- ctx .Error ( http . StatusInternalServerError , err . Error () )
64
+ ctx .ServerError ( "IsEmpty" , err )
65
65
return
66
66
} else if ! empty {
67
67
commit , err := ctx .Repo .GitRepo .GetBranchCommit (ctx .Repo .Repository .DefaultBranch )
68
68
if err != nil {
69
- ctx .Error ( http . StatusInternalServerError , err . Error () )
69
+ ctx .ServerError ( "GetBranchCommit" , err )
70
70
return
71
71
}
72
72
entries , err := actions .ListWorkflows (commit )
73
73
if err != nil {
74
- ctx .Error ( http . StatusInternalServerError , err . Error () )
74
+ ctx .ServerError ( "ListWorkflows" , err )
75
75
return
76
76
}
77
77
@@ -96,7 +96,7 @@ func List(ctx *context.Context) {
96
96
workflow := Workflow {Entry : * entry }
97
97
content , err := actions .GetContentFromEntry (entry )
98
98
if err != nil {
99
- ctx .Error ( http . StatusInternalServerError , err . Error () )
99
+ ctx .ServerError ( "GetContentFromEntry" , err )
100
100
return
101
101
}
102
102
wf , err := model .ReadWorkflow (bytes .NewReader (content ))
@@ -173,7 +173,7 @@ func List(ctx *context.Context) {
173
173
174
174
runs , total , err := actions_model .FindRuns (ctx , opts )
175
175
if err != nil {
176
- ctx .Error ( http . StatusInternalServerError , err . Error () )
176
+ ctx .ServerError ( "FindAndCount" , err )
177
177
return
178
178
}
179
179
@@ -182,15 +182,15 @@ func List(ctx *context.Context) {
182
182
}
183
183
184
184
if err := runs .LoadTriggerUser (ctx ); err != nil {
185
- ctx .Error ( http . StatusInternalServerError , err . Error () )
185
+ ctx .ServerError ( "LoadTriggerUser" , err )
186
186
return
187
187
}
188
188
189
189
ctx .Data ["Runs" ] = runs
190
190
191
191
actors , err := actions_model .GetActors (ctx , ctx .Repo .Repository .ID )
192
192
if err != nil {
193
- ctx .Error ( http . StatusInternalServerError , err . Error () )
193
+ ctx .ServerError ( "GetActors" , err )
194
194
return
195
195
}
196
196
ctx .Data ["Actors" ] = repo .MakeSelfOnTop (ctx .Doer , actors )
0 commit comments