Skip to content

Commit

Permalink
fix(Error.custom): improve ext argument detection
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Jun 5, 2017
1 parent bf098bc commit 0edbfbc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions error/custom.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
'use strict';

var assign = require('../object/assign')
var assign = require('../object/assign')
, isObject = require('../object/is-object')

, captureStackTrace = Error.captureStackTrace;

exports = module.exports = function (message/*, code, ext*/) {
var err = new Error(message), code = arguments[1], ext = arguments[2];
if (ext == null) {
if (code && (typeof code === 'object')) {
if (isObject(code)) {
ext = code;
code = null;
}
Expand Down

0 comments on commit 0edbfbc

Please sign in to comment.