@dotcom-reliability-kit/middleware-render-error-info
Advanced tools
Comparing version 4.0.2 to 4.1.0
@@ -84,3 +84,9 @@ const appInfo = require('@dotcom-reliability-kit/app-info'); | ||
const statusMessage = STATUS_CODES[statusCode] || STATUS_CODES[500]; | ||
const output = `${statusCode} ${statusMessage}\n`; | ||
let output = `${statusCode} ${statusMessage}\n`; | ||
// If the error has a fingerprint, add it to the output | ||
if (serializedError.fingerprint) { | ||
output += `(error code: ${serializedError.fingerprint})\n`; | ||
} | ||
response.send(output); | ||
@@ -87,0 +93,0 @@ }; |
@@ -128,2 +128,8 @@ const appInfo = require('@dotcom-reliability-kit/app-info'); | ||
{ | ||
label: 'Fingerprint', | ||
helpText: "A unique hash generated from this error's stack", | ||
value: error.fingerprint, | ||
formatter: renderCodeBlock | ||
}, | ||
{ | ||
label: 'Stack', | ||
@@ -130,0 +136,0 @@ helpText: |
{ | ||
"name": "@dotcom-reliability-kit/middleware-render-error-info", | ||
"version": "4.0.2", | ||
"version": "4.1.0", | ||
"description": "Express middleware to render error information in a way that makes local debugging easier and production error rendering more consistent.", | ||
@@ -19,4 +19,4 @@ "repository": { | ||
"dependencies": { | ||
"@dotcom-reliability-kit/app-info": "^2.2.0", | ||
"@dotcom-reliability-kit/log-error": "^3.1.5", | ||
"@dotcom-reliability-kit/app-info": "^2.3.0", | ||
"@dotcom-reliability-kit/log-error": "^3.1.6", | ||
"@dotcom-reliability-kit/serialize-error": "^2.2.0", | ||
@@ -23,0 +23,0 @@ "entities": "^4.5.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
28400
743