Skip to content

Commit

Permalink
fix: handle 404 by returning null objects instead of crashing (#8822)
Browse files Browse the repository at this point in the history
  • Loading branch information
aubin-tchoi authored Nov 22, 2024
1 parent 3dc2a3e commit e080271
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions connectors/src/connectors/zendesk/lib/zendesk_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ async function fetchFromZendeskWithRetries({
try {
response = await rawResponse.json();
} catch (e) {
if (rawResponse.status === 404) {
logger.error(
{ rawResponse, text: rawResponse.text },
"[Zendesk] Zendesk API 404 error"
);
return null;
}
logger.error(
{ rawResponse, status: rawResponse.status, text: rawResponse.text },
"[Zendesk] Error parsing Zendesk API response"
Expand Down

0 comments on commit e080271

Please sign in to comment.