mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-21 09:06:46 +09:00
1 parent
c30ddc3e14
commit
e60d1c7fc8
13 files changed
+29
-41
No files matched your search
@@ -190,15 +190,3 @@ func (ctx *Context) serverErrorInternal(skip int, logMsg string, logErr error) {
|
||||
ctx.Data["ErrorMsg"] = userErrorMsg
|
||||
ctx.HTML(http.StatusInternalServerError, tplStatus500)
|
||||
}
|
||||
|
||||
// NotFoundOrServerError use error check function to determine if the error
|
||||
// is about not found. It responds with 404 status code for not found error,
|
||||
// or error context description for logging purpose of 500 server error.
|
||||
// TODO: remove the "errCheck" and use util.ErrNotFound to check
|
||||
func (ctx *Context) NotFoundOrServerError(logMsg string, errCheck func(error) bool, logErr error) {
|
||||
if errCheck(logErr) {
|
||||
ctx.notFoundInternal(1, logMsg, logErr)
|
||||
return
|
||||
}
|
||||
ctx.serverErrorInternal(1, logMsg, logErr)
|
||||
}
|
||||
Reference in new issue
Block a user