diff --git a/error/custom.js b/error/custom.js index 368368a3..71f2c137 100644 --- a/error/custom.js +++ b/error/custom.js @@ -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; }