Loading lib/errors.js +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ function StatusCodeError(statusCode, message) { this.name = 'StatusCodeError'; this.statusCode = statusCode; this.message = statusCode + ' - ' + message; this.message = statusCode + ' - ' + (JSON && JSON.stringify ? JSON.stringify(message) : message); if (Error.captureStackTrace) { // if required for non-V8 envs - see PR #40 Error.captureStackTrace(this); Loading test/spec/request-test.js +1 −1 Original line number Diff line number Diff line Loading @@ -172,7 +172,7 @@ describe('Request-Promise', function () { expect(reason instanceof errors.StatusCodeError).to.eql(true); expect(reason.name).to.eql('StatusCodeError'); expect(reason.statusCode).to.eql(404); expect(reason.message).to.eql('404 - GET /404'); expect(reason.message).to.eql('404 - "GET /404"'); throw reason; // Testing Bluebird's catch by type }) Loading Loading
lib/errors.js +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ function StatusCodeError(statusCode, message) { this.name = 'StatusCodeError'; this.statusCode = statusCode; this.message = statusCode + ' - ' + message; this.message = statusCode + ' - ' + (JSON && JSON.stringify ? JSON.stringify(message) : message); if (Error.captureStackTrace) { // if required for non-V8 envs - see PR #40 Error.captureStackTrace(this); Loading
test/spec/request-test.js +1 −1 Original line number Diff line number Diff line Loading @@ -172,7 +172,7 @@ describe('Request-Promise', function () { expect(reason instanceof errors.StatusCodeError).to.eql(true); expect(reason.name).to.eql('StatusCodeError'); expect(reason.statusCode).to.eql(404); expect(reason.message).to.eql('404 - GET /404'); expect(reason.message).to.eql('404 - "GET /404"'); throw reason; // Testing Bluebird's catch by type }) Loading