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

Commit 155bffc0 by overlookmotel

Fix MySQL unique constraint error message parsing

1 parent cd145d24
Showing with 1 additions and 1 deletions
...@@ -53,7 +53,7 @@ module.exports = (function() { ...@@ -53,7 +53,7 @@ module.exports = (function() {
switch (err.errno || err.code) { switch (err.errno || err.code) {
case 1062: case 1062:
match = err.message.match(/Duplicate entry '(.*)' for key '?(.*?)$/); match = err.message.match(/Duplicate entry '(.*)' for key '?(.*?)'?$/);
return new sequelizeErrors.UniqueConstraintError({ return new sequelizeErrors.UniqueConstraintError({
fields: null, fields: null,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!