Fixed returned errors from API
This commit is contained in:
@@ -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()})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user