不要怂,就是干,撸起袖子干!

Commit 3cd0f893 by Victor Pontis

add check for another error message

1 parent fc064294
Showing with 3 additions and 0 deletions
......@@ -252,7 +252,10 @@ module.exports = (function() {
parent: err
});
case '23505':
// there are multiple different formats of error messages for this error code
// let's make sure to check both that we know about
match = err.detail.match(/Key \((.*?)\)=\((.*?)\) already exists/);
match = match || err.detail.match(/Key \((.*?)\)=\((.*?)\) is duplicated/);
return new sequelizeErrors.UniqueConstraintError({
fields: match[1].split(', '),
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!