Skip to content

Commit

Permalink
[API] on 500 error only show message if gitea in dev mode (#11641) (#…
Browse files Browse the repository at this point in the history
…11753)

* add API specific InternalServerError()

* return 500 error msg only if not Production mode

* rm unnessesary change
  • Loading branch information
6543 authored Jun 4, 2020
1 parent fb155b8 commit 99058de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/context/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ func (ctx *APIContext) Error(status int, title string, obj interface{}) {

if status == http.StatusInternalServerError {
log.ErrorWithSkip(1, "%s: %s", title, message)

if macaron.Env == macaron.PROD {
message = ""
}
}

ctx.JSON(status, APIError{
Expand Down

0 comments on commit 99058de

Please sign in to comment.