提交 ea85c4ad0bf7a03912f17020fa18140603b9a1ab

作者 Nick Baugh
2 个父辈 a1355cf1 7bf5e08e

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('_'))
... ...
注册登录 后发表评论