Skip to content

Commit

Permalink
enh: catch all 500,502,522 (#2963)
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 20, 2023
1 parent 4540656 commit 81a40d9
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions connectors/src/lib/temporal_monitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,17 @@ export class ActivityInboundLogInterceptor
maybeNangoError.status &&
[522, 502, 500].includes(maybeNangoError.status)
) {
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"
);
}
this.logger.info(
{
raw_json_error: JSON.stringify(maybeNangoError, null, 2),
},
"Got 5xx Bad Response from external API"
);
throw {
__is_dust_error: true,
message: `Got ${maybeNangoError.status} Bad Response from Nango`,
type: "nango_5xx_bad_response",
};
}

if (err instanceof ExternalOauthTokenError) {
Expand Down

0 comments on commit 81a40d9

Please sign in to comment.