Преглед на файлове

[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
tags/v1.12.0-rc2
6543 преди 4 години
родител
ревизия
99058de553
No account linked to committer's email address
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4
    0
      modules/context/api.go

+ 4
- 0
modules/context/api.go Целия файл



if status == http.StatusInternalServerError { if status == http.StatusInternalServerError {
log.ErrorWithSkip(1, "%s: %s", title, message) log.ErrorWithSkip(1, "%s: %s", title, message)

if macaron.Env == macaron.PROD {
message = ""
}
} }


ctx.JSON(status, APIError{ ctx.JSON(status, APIError{

Loading…
Отказ
Запис