Skip to content

Commit

Permalink
[errors] assign metadata to errors when they are not es "object" errors
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Dec 12, 2016
1 parent 258690c commit f9d2569
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib/errors.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var _ = require('./utils');
var qs = require('querystring');
var errors = module.exports;

var canCapture = (typeof Error.captureStackTrace === 'function');
Expand Down Expand Up @@ -159,7 +158,7 @@ _.each(statusCodes, function createStatusCodeError(tuple) {
// errors from es now come in two forms, an error string < 2.0 and
// an object >= 2.0
// TODO: remove after dropping support for < 2.0
ErrorAbstract.call(this, msg || primaryName, StatusCodeError);
ErrorAbstract.call(this, msg || primaryName, StatusCodeError, metadata);
return this;
}

Expand Down

0 comments on commit f9d2569

Please sign in to comment.