Skip to content

Commit 497f226

Browse files
committed
InternalServerError
1 parent 6f32067 commit 497f226

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/context/api.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,13 @@ func (ctx *APIContext) Error(status int, title string, obj interface{}) {
9090
func (ctx *APIContext) InternalServerError(err error) {
9191
log.ErrorWithSkip(1, "InternalServerError: %v", err)
9292

93+
var message string
94+
if macaron.Env != macaron.PROD {
95+
message = err.Error()
96+
}
97+
9398
ctx.JSON(http.StatusInternalServerError, APIError{
94-
Message: err.Error(),
99+
Message: message,
95100
URL: setting.API.SwaggerURL,
96101
})
97102
}

0 commit comments

Comments
 (0)