提交 ea85c4ad0bf7a03912f17020fa18140603b9a1ab
Merge pull request #12 from yanicklandry/feature/uncaught-db-error
fixed error message parsing
正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
... | ... | @@ -21,7 +21,7 @@ exports = module.exports = function(logger, settings) { |
21 | 21 | |
22 | 22 | if (_.isObject(err) && _.isNumber(err.code) && err.code === 11000) { |
23 | 23 | // <https://github.com/LearnBoost/mongoose/issues/2129> |
24 | - var field = err.message.split('index: test.')[1].split('.$')[1] | |
24 | + var field = err.message.split('index: ')[1].split('.$')[1] | |
25 | 25 | // now we have `email_1 dup key` |
26 | 26 | field = field.split(' dup key')[0] |
27 | 27 | field = field.substring(0, field.lastIndexOf('_')) | ... | ... |
请
注册
或
登录
后发表评论