提交 7bf5e08e8441e4f63bcd5260c4106d91ff8f3fad

作者 Yanick Landry
1 个父辈 a1355cf1

fixed error message parsing

正在显示 1 个修改的文件 包含 1 行增加1 行删除
@@ -21,7 +21,7 @@ exports = module.exports = function(logger, settings) { @@ -21,7 +21,7 @@ exports = module.exports = function(logger, settings) {
21 21
22 if (_.isObject(err) && _.isNumber(err.code) && err.code === 11000) { 22 if (_.isObject(err) && _.isNumber(err.code) && err.code === 11000) {
23 // <https://github.com/LearnBoost/mongoose/issues/2129> 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 // now we have `email_1 dup key` 25 // now we have `email_1 dup key`
26 field = field.split(' dup key')[0] 26 field = field.split(' dup key')[0]
27 field = field.substring(0, field.lastIndexOf('_')) 27 field = field.substring(0, field.lastIndexOf('_'))
注册登录 后发表评论