Skip to content

Commit 99058de

Browse files
authored
[API] on 500 error only show message if gitea in dev mode (#11641) (#11753)
* add API specific InternalServerError() * return 500 error msg only if not Production mode * rm unnessesary change
1 parent fb155b8 commit 99058de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/context/api.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ func (ctx *APIContext) Error(status int, title string, obj interface{}) {
7777

7878
if status == http.StatusInternalServerError {
7979
log.ErrorWithSkip(1, "%s: %s", title, message)
80+
81+
if macaron.Env == macaron.PROD {
82+
message = ""
83+
}
8084
}
8185

8286
ctx.JSON(status, APIError{

0 commit comments

Comments
 (0)