mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-24 05:33:40 +09:00
refactor: make git http respond error message (#39390)
* Refactor some bad smells in legacy code * Fix #37999: instead of creating an empty (undesired) wiki page, just tell users to create a wiki page first
This commit is contained in:
@@ -155,7 +155,7 @@ func (ctx *Context) notFoundInternal(skip int, logMsg string, logErr error) {
|
||||
|
||||
func (ctx *Context) buildUserErrorMessage(msg string, err error) (userErrorMsg string) {
|
||||
// it's safe to show internal error to admin users, and it helps
|
||||
if !setting.IsProd || (ctx.Doer != nil && ctx.Doer.IsAdmin) {
|
||||
if !setting.IsProd || setting.IsInTesting || (ctx.Doer != nil && ctx.Doer.IsAdmin) {
|
||||
userErrorMsg = msg
|
||||
if err != nil {
|
||||
userErrorMsg += ", error: " + err.Error()
|
||||
|
||||
Reference in New Issue
Block a user