Skip to content

Commit

Permalink
add logs to nango catch (#2941)
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Fontanier <[email protected]>
  • Loading branch information
fontanierh and Henry Fontanier authored Dec 19, 2023
1 parent 5803de3 commit fcf5a7d
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions connectors/src/lib/temporal_monitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,22 @@ export class ActivityInboundLogInterceptor
if (
maybeNangoError.code === "ERR_BAD_RESPONSE" &&
maybeNangoError.status &&
[522, 502, 500].includes(maybeNangoError.status) &&
maybeNangoError.config?.url?.includes("api.nango.dev")
[522, 502, 500].includes(maybeNangoError.status)
) {
throw {
__is_dust_error: true,
message: `Got ${maybeNangoError.status} Bad Response from Nango`,
type: "nango_5xx_bad_response",
};
if (maybeNangoError.config?.url?.includes("nango")) {
throw {
__is_dust_error: true,
message: `Got ${maybeNangoError.status} Bad Response from Nango`,
type: "nango_5xx_bad_response",
};
} else {
this.logger.info(
{
raw_json_error: JSON.stringify(maybeNangoError, null, 2),
},
"Got 5xx Bad Response from external API"
);
}
}

if (err instanceof ExternalOauthTokenError) {
Expand Down

0 comments on commit fcf5a7d

Please sign in to comment.