Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] on 500 error only show message if gitea in dev mode #11641

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 = ""
6543 marked this conversation as resolved.
Show resolved Hide resolved
}
}

ctx.JSON(status, APIError{
Expand Down