@dotcom-reliability-kit/serialize-error
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -59,2 +59,7 @@ /** | ||
// If set, we include the array of related systems | ||
if (error.relatesToSystems && Array.isArray(error.relatesToSystems)) { | ||
errorProperties.relatesToSystems = error.relatesToSystems; | ||
} | ||
// Only include error stack if it's a string | ||
@@ -99,2 +104,3 @@ if (typeof error.stack === 'string') { | ||
isOperational: false, | ||
relatesToSystems: [], | ||
stack: null, | ||
@@ -101,0 +107,0 @@ statusCode: null, |
{ | ||
"name": "@dotcom-reliability-kit/serialize-error", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A utility function to serialize an error object in a way that's friendly to loggers, view engines, and converting to JSON", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -47,2 +47,3 @@ | ||
// isOperational: false, | ||
// relatesToSystems: [], | ||
// stack: '...', | ||
@@ -82,2 +83,6 @@ // statusCode: null, | ||
#### `SerializedError.relatesToSystems` | ||
This array contains a list of [system codes](https://biz-ops.in.ft.com/list/Systems) which are related to the error. It defaults to an empty array. | ||
#### `SerializedError.stack` | ||
@@ -84,0 +89,0 @@ |
7990
98
108