smartprix / xorm

NodeJS ORM based on ObjectionJS with some extra utilities
18 stars 4 forks source link

The static Error class in each model should have some info about model #9

Closed ghost closed 6 years ago

ghost commented 6 years ago

On throwing an error through the Model.Error class, it just shows the error as an instance of UserError. It would be really helpful if the error instance had a property telling the model name from which the error was thrown.

rohit-gohri commented 6 years ago

This breaks the error parsing in graphQL side, I'm not quite sure how that is working. @smartprix

rohit-gohri commented 6 years ago

Will need to modify formatError function in https://github.com/smartprix/gqutils/blob/master/src/errors.js to also display any extra fields passed in Error