Comparing version 1.0.0 to 1.1.0
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
@@ -17,20 +17,20 @@ }); | ||
var code = _ref.code; | ||
var message = _ref.message; | ||
var cause = _ref.cause; | ||
var root_error_id = _ref.root_error_id; | ||
var stack_from = _ref.stack_from; | ||
let code = _ref.code; | ||
let message = _ref.message; | ||
let cause = _ref.cause; | ||
let root_error_id = _ref.root_error_id; | ||
let stack_from = _ref.stack_from; | ||
var error = new Error(message !== null ? message : undefined); | ||
const error = new Error(message !== null ? message : undefined); | ||
Error.captureStackTrace(error, stack_from || createError); | ||
var error_code = (0, _internals.getStatusCode)(code, cause); | ||
const error_code = (0, _internals.getStatusCode)(code, cause); | ||
(0, _boom.wrap)(error, error_code); | ||
error.code = error_code; | ||
var error_id = (0, _shortid.generate)(); | ||
const error_id = (0, _shortid.generate)(); | ||
error.error_id = error_id; | ||
error.output.payload.error_id = error_id; | ||
var root_id = (0, _internals.getRootErrorId)(root_error_id, cause) || error_id; | ||
const root_id = (0, _internals.getRootErrorId)(root_error_id, cause) || error_id; | ||
error.root_error_id = root_id; | ||
@@ -37,0 +37,0 @@ error.output.payload.root_error_id = root_id; |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
@@ -15,47 +15,25 @@ }); | ||
function getStatusCode(_x, _x2) { | ||
var _again = true; | ||
_function: while (_again) { | ||
var code = _x, | ||
cause = _x2; | ||
_again = false; | ||
if (typeof code === 'number' && code >= 400 && _http.STATUS_CODES[code]) { | ||
return code; | ||
function getStatusCode(code, cause) { | ||
if (typeof code === 'number' && code >= 400 && _http.STATUS_CODES[code]) { | ||
return code; | ||
} | ||
if (cause) { | ||
if (cause.output && cause.output.statusCode) { | ||
return getStatusCode(cause.output.statusCode, null); | ||
} | ||
if (cause) { | ||
if (cause.output && cause.output.statusCode) { | ||
_x = cause.output.statusCode; | ||
_x2 = null; | ||
_again = true; | ||
continue _function; | ||
} | ||
if (isJoi(cause)) { | ||
return 422; | ||
} | ||
if (isJoi(cause)) { | ||
return 422; | ||
} | ||
return 500; | ||
} | ||
return 500; | ||
} | ||
function getRootErrorId(_x3, _x4) { | ||
var _again2 = true; | ||
_function2: while (_again2) { | ||
var root_error_id = _x3, | ||
cause = _x4; | ||
_again2 = false; | ||
if (typeof root_error_id === 'string' && root_error_id.length > 5) { | ||
return root_error_id; | ||
} | ||
if (cause) { | ||
_x3 = cause.root_error_id; | ||
_x4 = undefined; | ||
_again2 = true; | ||
continue _function2; | ||
} | ||
return undefined; | ||
function getRootErrorId(root_error_id, cause) { | ||
if (typeof root_error_id === 'string' && root_error_id.length > 5) { | ||
return root_error_id; | ||
} | ||
if (cause) { | ||
return getRootErrorId(cause.root_error_id, undefined); | ||
} | ||
return undefined; | ||
} | ||
@@ -68,5 +46,5 @@ | ||
function toStringDebug() { | ||
var has_annotate = typeof this.annotate === 'function'; | ||
var details = has_annotate ? this.annotate() : (0, _util.format)(' %j', this.output.payload); | ||
return 'Error: ' + this.code + ' ' + this.message + ':\n' + details; | ||
const has_annotate = typeof this.annotate === 'function'; | ||
const details = has_annotate ? this.annotate() : (0, _util.format)(' %j', this.output.payload); | ||
return `Error: ${ this.code } ${ this.message }:\n${ details }`; | ||
} |
@@ -15,16 +15,20 @@ { | ||
"dependencies": { | ||
"boom": "2.9.0", | ||
"boom": "3.0.0", | ||
"shortid": "2.2.4" | ||
}, | ||
"devDependencies": { | ||
"babel": "5.8.23", | ||
"babel-eslint": "4.1.3", | ||
"commitizen": "2.3.0", | ||
"babel-cli": "6.2.0", | ||
"babel-core": "6.2.0", | ||
"babel-eslint": "4.1.5", | ||
"babel-plugin-transform-strict-mode": "6.2.0", | ||
"babel-preset-es2015-node4": "2.0.0", | ||
"commitizen": "2.4.6", | ||
"cz-conventional-changelog": "1.1.4", | ||
"eslint": "1.7.2", | ||
"eslint-config-springworks": "3.2.0", | ||
"eslint-plugin-mocha": "1.0.0", | ||
"eslint": "1.9.0", | ||
"eslint-config-springworks": "4.0.2", | ||
"eslint-plugin-import": "0.10.0", | ||
"eslint-plugin-mocha": "1.1.0", | ||
"istanbul": "0.4.0", | ||
"joi": "6.9.1", | ||
"mocha": "2.3.3", | ||
"joi": "7.0.0", | ||
"mocha": "2.3.4", | ||
"semantic-release": "4.3.5", | ||
@@ -38,2 +42,5 @@ "should": "7.1.1" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0" | ||
}, | ||
"repository": { | ||
@@ -49,3 +56,3 @@ "type": "git", | ||
"homepage": "https://github.com/Springworks/fel#readme", | ||
"version": "1.0.0" | ||
"version": "1.1.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
7
7416
16
78
+ Addedboom@3.0.0(transitive)
+ Addedhoek@3.0.4(transitive)
- Removedboom@2.9.0(transitive)
- Removedhoek@2.16.3(transitive)
Updatedboom@3.0.0