diff --git a/index.js b/index.js index 6b4566e..84c4828 100644 --- a/index.js +++ b/index.js @@ -176,8 +176,8 @@ function getErrorMessage (err, status, env) { // use util.format to get native Error print msg = util.format(err) + // fallback to err.toString() when possible if (!msg && typeof err.toString === 'function') { - // fallback to err.toString() when possible msg = err.toString() } } diff --git a/test/test.js b/test/test.js index feed457..a888b66 100644 --- a/test/test.js +++ b/test/test.js @@ -578,7 +578,7 @@ describe('finalhandler(req, res)', function () { }) }) - describe.only('Errors with cause', function () { + describe('Errors with cause', function () { it('should return Error message with 1 level cause trace', function (done) { var err = new Error('foo', { cause: new Error('bar') })