diff --git a/models/utils/common.go b/models/utils/common.go index 4e30b23..7259cc5 100755 --- a/models/utils/common.go +++ b/models/utils/common.go @@ -49,7 +49,7 @@ func GenericStoreOne(data DBObject, a Accessor) (DBObject, int, error) { } err := validate.Struct(data) if err != nil { - return nil, 422, err + return nil, 422, errors.New("error when validating the received struct: " + err.Error()) } id, code, err := mongo.MONGOService.StoreOne(data, data.GetID(), a.GetType().String()) if err != nil {