From 3034ad0b10e7cd9c464132bdcce50743029a31f5 Mon Sep 17 00:00:00 2001 From: Derek Croote Date: Tue, 29 Nov 2022 21:35:48 -0800 Subject: [PATCH] fix: undefined error property in json logging --- .changeset/strong-llamas-laugh.md | 5 +++++ packages/airnode-utilities/src/logging/logging.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/strong-llamas-laugh.md diff --git a/.changeset/strong-llamas-laugh.md b/.changeset/strong-llamas-laugh.md new file mode 100644 index 0000000000..cda985b057 --- /dev/null +++ b/.changeset/strong-llamas-laugh.md @@ -0,0 +1,5 @@ +--- +'@api3/airnode-utilities': patch +--- + +Fix logging undefined error property bug diff --git a/packages/airnode-utilities/src/logging/logging.ts b/packages/airnode-utilities/src/logging/logging.ts index 58d02a31eb..3b89b9f185 100644 --- a/packages/airnode-utilities/src/logging/logging.ts +++ b/packages/airnode-utilities/src/logging/logging.ts @@ -117,7 +117,7 @@ export function logFull(level: LogLevel, message: string, options: LogOptions | } json(level, message, options); - if (level === 'ERROR' && (options as ErrorLogOptions).error!.stack!) { + if (level === 'ERROR' && (options as ErrorLogOptions).error?.stack) { json('ERROR', (options as ErrorLogOptions).error!.stack!, options); } }