mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00: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:
committed by
Lauris BH
parent
45c264f681
commit
65861900cd
@@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user