Skip to content

Commit

Permalink
🔈 delegate 404 HTTP Errors correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiparra committed Jun 13, 2023
1 parent 10500f9 commit 5a1b6f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/models/integration-error.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum IntegrationErrorType {
INTEGRATION_ERROR_UNAVAILABLE = "integration/error/unavailable",

ENTITY_ERROR_CONFLICT = "entity/error/conflict",
ENTITY_NOT_FOUND = "entity/not-found",

CONTACT_CREATE_ERROR_CONFLICT = "contact/create-error/conflict",
CONTACT_CREATE_ERROR_EMAIL_CONFLICT = "contact/create-error/email-conflict",
Expand Down
3 changes: 3 additions & 0 deletions src/util/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export const throwAndDelegateError = (
case 403:
errorType = IntegrationErrorType.INTEGRATION_ERROR_FORBIDDEN;
break;
case 404:
errorType = IntegrationErrorType.ENTITY_NOT_FOUND;
break;
case 409:
errorType = IntegrationErrorType.ENTITY_ERROR_CONFLICT;
break;
Expand Down

0 comments on commit 5a1b6f9

Please sign in to comment.