Skip to content

Commit

Permalink
Merge pull request #18 from vivid-planet/fix-brevo-contact-info-by-em…
Browse files Browse the repository at this point in the history
…ail-error

fix brevo throwing 400 error instead of expected 404 error code
  • Loading branch information
RainbowBunchie authored Jan 24, 2024
2 parents 826edbc + 7c8cfcb commit f165fc3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/api/src/brevo-api/brevo-api-contact.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ export class BrevoApiContactsService {
if (!contact) return undefined;
return contact;
} catch (error) {
// Brevo throws 404 error if no contact was found
if (isErrorFromBrevo(error) && error.response.statusCode === 404) {
// Brevo throws 400 error if no contact was found
if (isErrorFromBrevo(error) && error.response.statusCode === 400) {
return undefined;
}

throw error;
}
}
Expand Down

0 comments on commit f165fc3

Please sign in to comment.