Fixed returned errors from API

This commit is contained in:
2026-02-23 18:21:01 +01:00
parent 0702a2b0cb
commit b28dac0f93

View File

@@ -48,7 +48,7 @@ func ReturnErrorsAsJsonResponse(ac *appcontext.AppContext, err error) {
} else if errors.As(err, &httpError) { } else if errors.As(err, &httpError) {
ac.C.JSON(httpError.StatusCode, gin.H{"error": httpError.Err.Error()}) ac.C.JSON(httpError.StatusCode, gin.H{"error": httpError.Err.Error()})
} else { } else {
ac.C.JSON(http.StatusInternalServerError, gin.H{"error": err}) ac.C.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
} }
} }