From 3791f345816da8c2e0954021b5646fa13249bece Mon Sep 17 00:00:00 2001 From: Vasilis Xouris Date: Thu, 25 Jul 2024 13:07:51 -0700 Subject: [PATCH 1/3] chore(logging): log 500 error details --- lib/handlers/quote/quote.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/handlers/quote/quote.ts b/lib/handlers/quote/quote.ts index 20586b1cc..59f0e8a8f 100644 --- a/lib/handlers/quote/quote.ts +++ b/lib/handlers/quote/quote.ts @@ -126,6 +126,16 @@ export class QuoteHandler extends APIGLambdaHandler< 1, MetricLoggerUnit.Count ) + log.error( + { + statusCode: result?.statusCode, + errorCode: result?.errorCode, + detail: result?.detail, + }, + `Quote 5XX Error [${result?.statusCode}] on ${ID_TO_NETWORK_NAME(chainId)} with errorCode '${ + result?.errorCode + }': ${result?.detail}` + ) break } } catch (err) { From bf1df848eeb92b052bf866a24ad4a5cb33a46cf0 Mon Sep 17 00:00:00 2001 From: Vasilis Xouris Date: Thu, 1 Aug 2024 11:13:34 -0700 Subject: [PATCH 2/3] add exception error log --- lib/handlers/quote/quote.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/handlers/quote/quote.ts b/lib/handlers/quote/quote.ts index 59f0e8a8f..3b7831438 100644 --- a/lib/handlers/quote/quote.ts +++ b/lib/handlers/quote/quote.ts @@ -150,6 +150,10 @@ export class QuoteHandler extends APIGLambdaHandler< MetricLoggerUnit.Count ) + log.error( + `Quote 5XX Error on ${ID_TO_NETWORK_NAME(chainId)} with exception '${err}'`, + ) + throw err } finally { // This metric is logged after calling the internal handler to correlate with the status metrics From 8aee834df09af4d90b49ec618ed4e3598e008bb8 Mon Sep 17 00:00:00 2001 From: Vasilis Xouris Date: Thu, 1 Aug 2024 11:59:33 -0700 Subject: [PATCH 3/3] npm run fix:prettier --- lib/handlers/quote/quote.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/handlers/quote/quote.ts b/lib/handlers/quote/quote.ts index 3b7831438..78876b6fa 100644 --- a/lib/handlers/quote/quote.ts +++ b/lib/handlers/quote/quote.ts @@ -150,9 +150,7 @@ export class QuoteHandler extends APIGLambdaHandler< MetricLoggerUnit.Count ) - log.error( - `Quote 5XX Error on ${ID_TO_NETWORK_NAME(chainId)} with exception '${err}'`, - ) + log.error(`Quote 5XX Error on ${ID_TO_NETWORK_NAME(chainId)} with exception '${err}'`) throw err } finally {