opened
kirrg001
username_0
I think this will simplify the code, whilst letting us still return super smart JSON error responses via the API.

This was the original comment: https://github.com/TryGhost/Ghost/issues/7116#issuecomment-252231809

To sum up: we would like to support multiple errors in one Error instead of having an error as single instance or as array.

Example:
```
var err = new errors.ValidationError({
    children: [new errors.GhostError(), new errors.GhostError()]
}):
```
Support multiple errors inside of one Error
issue
created
kirrg001
username_0
Right now we are using `validation.validateSchema` in the Base Model to validate incoming properties. This function can return an Array with errors. This also needs to be changed. So the caller can always expect to get one single error back.
comment
created
kirrg001
username_0
`Promise.reject(Array)` does not work with `bluebird`.
That's why we are seeing lot's of warnings when running the tests.

```(node:22866) Warning: a promise was rejected with a non-error: [object Array]```

Most of them are coming from [here](https://github.com/TryGhost/Ghost/blob/master/core/server/data/validation/index.js#L103).
comment
created
ErisDS
username_1
I don't see this ever happening or really being useful, @username_0 suggest we close?
comment
created
kirrg001
username_0
Yeah let's close it 👍It might be useful for some cases e.g. return a set of validation errors, but i doubt somebody will work on it in the future 😁
comment
closed
kirrg001
username_0
issue