mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 18:05:19 +02:00
Handle refactor (#3339)
* Replace all ctx.Handle with ctx.ServerError or ctx.NotFound * Change Handle(403) to NotFound, avoid using macaron's NotFound
This commit is contained in:
parent
45c264f681
commit
65861900cd
48 changed files with 622 additions and 610 deletions
|
@ -59,13 +59,13 @@ func SingleDownload(ctx *context.Context) {
|
|||
blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreePath)
|
||||
if err != nil {
|
||||
if git.IsErrNotExist(err) {
|
||||
ctx.Handle(404, "GetBlobByPath", nil)
|
||||
ctx.NotFound("GetBlobByPath", nil)
|
||||
} else {
|
||||
ctx.Handle(500, "GetBlobByPath", err)
|
||||
ctx.ServerError("GetBlobByPath", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
if err = ServeBlob(ctx, blob); err != nil {
|
||||
ctx.Handle(500, "ServeBlob", err)
|
||||
ctx.ServerError("ServeBlob", err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue