From 7466916e0206d55826d74f37c251bb5e40182c00 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sun, 19 Apr 2026 22:24:24 +0300 Subject: Add custom geosite/geoip URL sources (#3980) * feat: add custom geosite/geoip URL sources Register DB model, panel API, index/xray UI, and i18n. * fix --- web/controller/util.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'web/controller/util.go') diff --git a/web/controller/util.go b/web/controller/util.go index b11203bd..3d266f29 100644 --- a/web/controller/util.go +++ b/web/controller/util.go @@ -50,8 +50,17 @@ func jsonMsgObj(c *gin.Context, msg string, obj any, err error) { } } else { m.Success = false - m.Msg = msg + " (" + err.Error() + ")" - logger.Warning(msg+" "+I18nWeb(c, "fail")+": ", err) + errStr := err.Error() + if errStr != "" { + m.Msg = msg + " (" + errStr + ")" + logger.Warning(msg+" "+I18nWeb(c, "fail")+": ", err) + } else if msg != "" { + m.Msg = msg + logger.Warning(msg + " " + I18nWeb(c, "fail")) + } else { + m.Msg = I18nWeb(c, "somethingWentWrong") + logger.Warning(I18nWeb(c, "somethingWentWrong") + " " + I18nWeb(c, "fail")) + } } c.JSON(http.StatusOK, m) } -- cgit v1.2.3