@ministryofjustice/fb-jwt-client-node
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -287,12 +287,12 @@ const request = require('request-promise-native') | ||
} else if (err.error) { | ||
const code = err.error.code || 'EUNSPECIFIED' | ||
const message = err.error.name || err.error.code || 'EUNSPECIFIED' | ||
let statusCode = 500 | ||
if (code === 'ENOTFOUND') { | ||
if (message === 'ENOTFOUND') { | ||
// no dns resolution | ||
statusCode = 502 | ||
} else if (code === 'ECONNREFUSED') { | ||
} else if (message === 'ECONNREFUSED') { | ||
// connection rejected | ||
statusCode = 503 | ||
} | ||
this.throwRequestError(statusCode, code) | ||
this.throwRequestError(statusCode, message) | ||
// Handle errors that have not been specified | ||
@@ -299,0 +299,0 @@ } else { |
@@ -314,3 +314,3 @@ const test = require('tape') | ||
error.error = { | ||
code: requestErrorCode | ||
name: requestErrorCode | ||
} | ||
@@ -383,3 +383,3 @@ } else { | ||
test('When making a get request and an unspecified error code is returned', async t => { | ||
testGetError(t, 'EMADEUP', 500) | ||
testGetError(t, 'e.madeup', 500) | ||
}) | ||
@@ -414,3 +414,3 @@ | ||
test('When making a post request and an unspecified error code is returned', async t => { | ||
testPostError(t, 'EMADEUP', 500) | ||
testPostError(t, 'e.madeup', 500) | ||
}) | ||
@@ -417,0 +417,0 @@ |
{ | ||
"name": "@ministryofjustice/fb-jwt-client-node", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "Form Builder JSON Web Token Client (Node)", | ||
@@ -20,7 +20,7 @@ "main": "lib/fb-jwt-client.js", | ||
"devDependencies": { | ||
"@ministryofjustice/eslint-config-fb": "^1.0.4", | ||
"@ministryofjustice/eslint-config-fb": "^1.0.5", | ||
"multi-tape": "^1.2.1", | ||
"npm-run-all": "^4.1.5", | ||
"proxyquire": "^2.1.0", | ||
"sinon": "^7.2.7", | ||
"sinon": "^7.3.1", | ||
"tape": "^4.10.1" | ||
@@ -31,3 +31,3 @@ }, | ||
"aes256": "^1.0.4", | ||
"jsonwebtoken": "^8.5.0", | ||
"jsonwebtoken": "^8.5.1", | ||
"path-to-regexp": "^3.0.0", | ||
@@ -34,0 +34,0 @@ "request": "^2.88.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34733
Updatedjsonwebtoken@^8.5.1