You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UnknownConstraintError#message ends up as an object rather than a string #9505
This is breaking some error handling libraries I'm using because they expect err.message to be a string (which is reasonable).
As far as I can tell from the source code, it is the intention to leave message as a string, but when an object is passed to the constructor here, it's interpreted as a string here. Perhaps the intention was to always take an options object like the error class defined above?
Activity
sushantdhiman commentedon Jun 5, 2018
Your observation is correct,
UniqueConstraintconstructor should be acceptingoptionslike all other errorsSSCCE
{ "name": "SequelizeUnknownConstraintError", "parent": { "message": { "message": "Unknown constraint error", "parent": { "name": "error", "length": 124, "severity": "ERROR", "code": "42704", "file": "tablecmds.c", "line": "7748", "routine": "ATExecDropConstraint", "sql": "ALTER TABLE users DROP CONSTRAINT i_do_not_exist" } } }, "original": { "message": { "message": "Unknown constraint error", "parent": { "name": "error", "length": 124, "severity": "ERROR", "code": "42704", "file": "tablecmds.c", "line": "7748", "routine": "ATExecDropConstraint", "sql": "ALTER TABLE users DROP CONSTRAINT i_do_not_exist" } } } }Ankit7991 commentedon Aug 21, 2020
Is it possible withour {force: true},
Ankit7991 commentedon Aug 21, 2020
Or I should take backup, then force: true and put backup data back in mysql.