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

Commit e1162d56 by Samuel Debionne

errDetail may be undefined

1 parent ad124e3b
Showing with 1 additions and 3 deletions
...@@ -303,9 +303,7 @@ Query.prototype.formatError = function (err) { ...@@ -303,9 +303,7 @@ Query.prototype.formatError = function (err) {
case '23505': case '23505':
// there are multiple different formats of error messages for this error code // there are multiple different formats of error messages for this error code
// this regex should check at least two // this regex should check at least two
match = errDetail.replace(/"/g, '').match(/Key \((.*?)\)=\((.*?)\)/); if (errDetail && (match = errDetail.replace(/"/g, '').match(/Key \((.*?)\)=\((.*?)\)/))) {
if (match) {
fields = _.zipObject(match[1].split(', '), match[2].split(', ')); fields = _.zipObject(match[1].split(', '), match[2].split(', '));
errors = []; errors = [];
message = 'Validation error'; message = 'Validation error';
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!