@@ -61,17 +61,17 @@ func List(ctx *context.Context) {
6161
6262 var workflows []Workflow
6363 if empty , err := ctx .Repo .GitRepo .IsEmpty (); err != nil {
64- ctx .Error ( http . StatusInternalServerError , err . Error () )
64+ ctx .ServerError ( "IsEmpty" , err )
6565 return
6666 } else if ! empty {
6767 commit , err := ctx .Repo .GitRepo .GetBranchCommit (ctx .Repo .Repository .DefaultBranch )
6868 if err != nil {
69- ctx .Error ( http . StatusInternalServerError , err . Error () )
69+ ctx .ServerError ( "GetBranchCommit" , err )
7070 return
7171 }
7272 entries , err := actions .ListWorkflows (commit )
7373 if err != nil {
74- ctx .Error ( http . StatusInternalServerError , err . Error () )
74+ ctx .ServerError ( "ListWorkflows" , err )
7575 return
7676 }
7777
@@ -96,7 +96,7 @@ func List(ctx *context.Context) {
9696 workflow := Workflow {Entry : * entry }
9797 content , err := actions .GetContentFromEntry (entry )
9898 if err != nil {
99- ctx .Error ( http . StatusInternalServerError , err . Error () )
99+ ctx .ServerError ( "GetContentFromEntry" , err )
100100 return
101101 }
102102 wf , err := model .ReadWorkflow (bytes .NewReader (content ))
@@ -173,7 +173,7 @@ func List(ctx *context.Context) {
173173
174174 runs , total , err := actions_model .FindRuns (ctx , opts )
175175 if err != nil {
176- ctx .Error ( http . StatusInternalServerError , err . Error () )
176+ ctx .ServerError ( "FindAndCount" , err )
177177 return
178178 }
179179
@@ -182,15 +182,15 @@ func List(ctx *context.Context) {
182182 }
183183
184184 if err := runs .LoadTriggerUser (ctx ); err != nil {
185- ctx .Error ( http . StatusInternalServerError , err . Error () )
185+ ctx .ServerError ( "LoadTriggerUser" , err )
186186 return
187187 }
188188
189189 ctx .Data ["Runs" ] = runs
190190
191191 actors , err := actions_model .GetActors (ctx , ctx .Repo .Repository .ID )
192192 if err != nil {
193- ctx .Error ( http . StatusInternalServerError , err . Error () )
193+ ctx .ServerError ( "GetActors" , err )
194194 return
195195 }
196196 ctx .Data ["Actors" ] = repo .MakeSelfOnTop (ctx .Doer , actors )
0 commit comments