0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

chore: add app insights log for oidc server error (#6815)

add app insights log for oidc server error
This commit is contained in:
simeng-li 2024-11-18 14:40:03 +08:00 committed by GitHub
parent 4658bd2623
commit 9ca5ae8f30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -95,6 +95,9 @@ export default function koaOidcErrorHandler<StateT, ContextT>(): Middleware<Stat
// See https://github.com/panva/node-oidc-provider/blob/37d0a6cfb3c618141a44cbb904ce45659438f821/lib/shared/error_handler.js
ctx.status = error.statusCode || 500;
ctx.body = errorOut(error);
// Track the original error in App Insights.
void appInsights.trackException(error, buildAppInsightsTelemetry(ctx));
}
// Parse the `parse_error` from the query string.