diff --git a/errors.js b/errors.js index cbaca0fa..217f46f9 100644 --- a/errors.js +++ b/errors.js @@ -52,7 +52,6 @@ class HttpErrorAuthUnknown extends HttpErrorBase { constructor (method, res, body, spec) { super(method, res, body, spec) this.message = 'Unable to authenticate, need: ' + res.headers.get('www-authenticate') - this.code = 'EAUTHUNOWN' Error.captureStackTrace(this, HttpErrorAuthUnknown) } } diff --git a/test/errors.js b/test/errors.js index 593a5500..0dcdd423 100644 --- a/test/errors.js +++ b/test/errors.js @@ -117,7 +117,7 @@ test('Unexpected www-authenticate error', t => { () => { throw new Error('Should not have succeeded!') }, err => { t.match(err.body.error, /Pat-a-cake/ig, 'error body explains it') - t.equal(err.code, 'EAUTHUNOWN', 'got a special pokemon') + t.equal(err.code, 'E401', 'Unknown auth errors are generic 401s') } ) })