mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 22:17:20 +00:00
Improve "not found" error messages for API (#34267)
Make the message clear, for example: #34266
This commit is contained in:
@ -313,7 +313,7 @@ func RepoRefForAPI(next http.Handler) http.Handler {
|
||||
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetCommit(refName)
|
||||
}
|
||||
if ctx.Repo.Commit == nil || errors.Is(err, util.ErrNotExist) {
|
||||
ctx.APIErrorNotFound(fmt.Errorf("not exist: '%s'", ctx.PathParam("*")))
|
||||
ctx.APIErrorNotFound("unable to find a git ref")
|
||||
return
|
||||
} else if err != nil {
|
||||
ctx.APIErrorInternal(err)
|
||||
|
Reference in New Issue
Block a user