@hapi/boom
Advanced tools
Comparing version 7.4.4 to 7.4.5
@@ -86,10 +86,11 @@ 'use strict'; | ||
error.data = data; | ||
internals.initialize(error, statusCode); | ||
error.typeof = ctor; | ||
const boom = internals.initialize(error, statusCode); | ||
Object.defineProperty(boom, 'typeof', { value: ctor }); | ||
if (options.decorate) { | ||
Object.assign(error, options.decorate); | ||
Object.assign(boom, options.decorate); | ||
} | ||
return error; | ||
return boom; | ||
} | ||
@@ -375,3 +376,2 @@ | ||
internals.initialize = function (err, statusCode, message) { | ||
@@ -395,3 +395,3 @@ | ||
err.reformat = internals.reformat; | ||
Object.defineProperty(err, 'reformat', { value: internals.reformat }); | ||
@@ -406,2 +406,5 @@ if (!message && | ||
if (message) { | ||
const props = Object.getOwnPropertyDescriptor(err, 'message') || Object.getOwnPropertyDescriptor(Object.getPrototypeOf(err), 'message'); | ||
Hoek.assert(props.configurable && !props.get, 'The error is not compatible with boom'); | ||
err.message = message + (err.message ? ': ' + err.message : ''); | ||
@@ -408,0 +411,0 @@ err.output.payload.message = err.message; |
{ | ||
"name": "@hapi/boom", | ||
"description": "HTTP-friendly error objects", | ||
"version": "7.4.4", | ||
"version": "7.4.5", | ||
"repository": "git://github.com/hapijs/boom", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.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
27306
693