mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +00:00
Updates to API 404 responses (#6077)
This commit is contained in:
parent
d10a668ffc
commit
cac9e6e760
30 changed files with 120 additions and 91 deletions
|
@ -42,13 +42,13 @@ func GetBranch(ctx *context.APIContext) {
|
|||
// if TreePath != "", then URL contained extra slashes
|
||||
// (i.e. "master/subbranch" instead of "master"), so branch does
|
||||
// not exist
|
||||
ctx.Status(404)
|
||||
ctx.NotFound()
|
||||
return
|
||||
}
|
||||
branch, err := ctx.Repo.Repository.GetBranch(ctx.Repo.BranchName)
|
||||
if err != nil {
|
||||
if models.IsErrBranchNotExist(err) {
|
||||
ctx.Error(404, "GetBranch", err)
|
||||
ctx.NotFound(err)
|
||||
} else {
|
||||
ctx.Error(500, "GetBranch", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue