Skip to content

Commit

Permalink
InternalServerError
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed May 27, 2020
1 parent 6f32067 commit 497f226
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/context/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,13 @@ func (ctx *APIContext) Error(status int, title string, obj interface{}) {
func (ctx *APIContext) InternalServerError(err error) {
log.ErrorWithSkip(1, "InternalServerError: %v", err)

var message string
if macaron.Env != macaron.PROD {
message = err.Error()
}

ctx.JSON(http.StatusInternalServerError, APIError{
Message: err.Error(),
Message: message,
URL: setting.API.SwaggerURL,
})
}
Expand Down

0 comments on commit 497f226

Please sign in to comment.