Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(logging): add logging for 500 errors #806

Merged
merged 4 commits into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/handlers/quote/quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -140,6 +150,8 @@ 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
Expand Down
Loading