@@ -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
@@ -95,7 +95,7 @@ func List(ctx *context.Context) {
95
95
workflow := Workflow {Entry : * entry }
96
96
content , err := actions .GetContentFromEntry (entry )
97
97
if err != nil {
98
- ctx .Error ( http . StatusInternalServerError , err . Error () )
98
+ ctx .ServerError ( "GetContentFromEntry" , err )
99
99
return
100
100
}
101
101
wf , err := model .ReadWorkflow (bytes .NewReader (content ))
@@ -172,7 +172,7 @@ func List(ctx *context.Context) {
172
172
173
173
runs , total , err := db .FindAndCount [actions_model.ActionRun ](ctx , opts )
174
174
if err != nil {
175
- ctx .Error ( http . StatusInternalServerError , err . Error () )
175
+ ctx .ServerError ( "FindAndCount" , err )
176
176
return
177
177
}
178
178
@@ -181,15 +181,15 @@ func List(ctx *context.Context) {
181
181
}
182
182
183
183
if err := actions_model .RunList (runs ).LoadTriggerUser (ctx ); err != nil {
184
- ctx .Error ( http . StatusInternalServerError , err . Error () )
184
+ ctx .ServerError ( "LoadTriggerUser" , err )
185
185
return
186
186
}
187
187
188
188
ctx .Data ["Runs" ] = runs
189
189
190
190
actors , err := actions_model .GetActors (ctx , ctx .Repo .Repository .ID )
191
191
if err != nil {
192
- ctx .Error ( http . StatusInternalServerError , err . Error () )
192
+ ctx .ServerError ( "GetActors" , err )
193
193
return
194
194
}
195
195
ctx .Data ["Actors" ] = repo .MakeSelfOnTop (ctx .Doer , actors )
0 commit comments