diff --git a/core/controllers/base.go b/core/controllers/base.go index 2ec01277..47a91206 100644 --- a/core/controllers/base.go +++ b/core/controllers/base.go @@ -18,8 +18,12 @@ import ( func init() { tonic.SetErrorHook(func(context *gin.Context, err error) (int, interface{}) { + unwrappedErr := errors.Unwrap(err) + if unwrappedErr != nil { + err = unwrappedErr + } response := gin.H{ - "error": errors.Unwrap(err).Error(), + "error": err.Error(), } status := http.StatusInternalServerError constErr, ok := errors.AsType[errors.ConstError](err)