ソースを参照

[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
コミッターのメールアドレスに関連付けられたアカウントが存在しません
1個のファイルの変更4行の追加0行の削除
  1. 4
    0
      modules/context/api.go

+ 4
- 0
modules/context/api.go ファイルの表示

@@ -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{

読み込み中…
キャンセル
保存