Fix api error handling

This commit is contained in:
Abhishek Shroff
2024-08-06 23:21:02 +05:30
parent 9023a2bea4
commit abbd73b2d2
+1 -1
View File
@@ -22,7 +22,7 @@ func Setup(r *gin.RouterGroup, a *app.App) {
func handleApiError(c *gin.Context) {
defer func() {
if err := recover(); err != nil {
if e, ok := err.(errors.Err); ok {
if e, ok := err.(*errors.Err); ok {
c.AbortWithStatusJSON(e.Status, e)
} else {
panic(err)