Bläddra i källkod

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

* add API specific InternalServerError()

* return 500 error msg only if not Production mode

* rm unnessesary change
tags/v1.13.0-rc1
6543 4 år sedan
förälder
incheckning
ce7510a80f
Inget konto är kopplat till bidragsgivarens mejladress
1 ändrade filer med 4 tillägg och 0 borttagningar
  1. 4
    0
      modules/context/api.go

+ 4
- 0
modules/context/api.go Visa fil

@@ -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 = ""
}
}

ctx.JSON(status, APIError{

Laddar…
Avbryt
Spara