Skip to content

Commit 6eb18a6

Browse files
6543Yohann Delafollye
authored andcommitted
[API] on 500 error only show message if gitea in dev mode (go-gitea#11641)
* add API specific InternalServerError() * return 500 error msg only if not Production mode * rm unnessesary change
1 parent db54b71 commit 6eb18a6

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)