mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +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:
parent
45c264f681
commit
65861900cd
48 changed files with 622 additions and 610 deletions
|
@ -15,7 +15,7 @@ func SetEditorconfigIfExists(ctx *context.Context) {
|
|||
if err != nil && !git.IsErrNotExist(err) {
|
||||
description := fmt.Sprintf("Error while getting .editorconfig file: %v", err)
|
||||
if err := models.CreateRepositoryNotice(description); err != nil {
|
||||
ctx.Handle(500, "ErrCreatingReporitoryNotice", err)
|
||||
ctx.ServerError("ErrCreatingReporitoryNotice", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -47,6 +47,6 @@ func SetDiffViewStyle(ctx *context.Context) {
|
|||
|
||||
ctx.Data["IsSplitStyle"] = style == "split"
|
||||
if err := ctx.User.UpdateDiffViewStyle(style); err != nil {
|
||||
ctx.Handle(500, "ErrUpdateDiffViewStyle", err)
|
||||
ctx.ServerError("ErrUpdateDiffViewStyle", err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue