loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: improve error handling of commit rendering (#7130)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7130
Reviewed-by: Otto <otto@codeberg.org>

Otto e4a21a14 5e08b51f

+2 -6
+2 -6
routers/web/repo/commit.go
··· 315 315 316 316 commit, err := gitRepo.GetCommit(commitID) 317 317 if err != nil { 318 - if git.IsErrNotExist(err) { 319 - ctx.NotFound("Repo.GitRepo.GetCommit", err) 320 - } else { 321 - ctx.ServerError("Repo.GitRepo.GetCommit", err) 322 - } 318 + ctx.NotFoundOrServerError("gitRepo.GetCommit", git.IsErrNotExist, err) 323 319 return 324 320 } 325 321 if len(commitID) != commit.ID.Type().FullLength() { ··· 343 339 FileOnly: fileOnly, 344 340 }, files...) 345 341 if err != nil { 346 - ctx.NotFound("GetDiff", err) 342 + ctx.ServerError("GetDiff", err) 347 343 return 348 344 } 349 345