Closed leibowitz closed 4 years ago
can you change checking of the type (instanceof
) to checking by the error.name?
instanceof
doesn't work well when you have related packages where one depends on the other. It is super hard to explain but I will try :).
Let say you are working on let say my-admin-bro package and this package depends on sequelize and also it depends on admin-bro-sequlelize which depends on sequelize sometimes (especially in dev environment).
In that case Sequelize required from admin-bro is not the same as sequelize from admin-bro-sequelize (npm installs different versions of the same library) that is why instanceof won't work.
In order to fix that we require sequelize as a peerDependency
in admin-bro-sequelize but it is only in production. In dev and test environments we have it set as a regular dependency
:tada: This PR is included in version 1.0.0-beta.3 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
thanks!!!
:tada: This PR is included in version 1.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Fix #17
Handle all
ValidationError
from sequelize and pass them backThis handles
UniqueConstraintError
as well, since it extends onValidationError