@ministryofjustice/fb-jwt-client-node
Advanced tools
Comparing version 0.0.21-beta to 0.0.21-delta
@@ -275,2 +275,5 @@ const request = require('request-promise-native') | ||
console.log('JWTCLIENT handleRequestError', err.name, this.ErrorClass.name) | ||
if (err.error) { | ||
console.log('err.error', err.error) | ||
} | ||
// rethrow error if already client error | ||
@@ -286,3 +289,7 @@ if (err.name === this.ErrorClass.name) { | ||
} else { | ||
this.throwRequestError(statusCode) | ||
let message | ||
if (err.error) { | ||
message = err.error.name || err.error.code || 'EUNSPECIFIED' | ||
} | ||
this.throwRequestError(statusCode, message) | ||
} | ||
@@ -322,2 +329,9 @@ } else if (err.error) { | ||
message = message || code | ||
console.log('throwRequestError - BLIMEY', code, message, new this.ErrorClass(message, { | ||
message, | ||
error: { | ||
code, | ||
message | ||
} | ||
})) | ||
throw new this.ErrorClass(message, { | ||
@@ -324,0 +338,0 @@ message, |
{ | ||
"name": "@ministryofjustice/fb-jwt-client-node", | ||
"version": "0.0.21-beta", | ||
"version": "0.0.21-delta", | ||
"description": "Form Builder JSON Web Token Client (Node)", | ||
@@ -5,0 +5,0 @@ "main": "lib/fb-jwt-client.js", |
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
35217
877