From 5a1b6f9868535b4c9e8770ad92083535bb6f3db2 Mon Sep 17 00:00:00 2001 From: pkiparra <89983891+pkiparra@users.noreply.github.com> Date: Tue, 13 Jun 2023 13:38:23 +0200 Subject: [PATCH] :speaker: delegate 404 HTTP Errors correctly --- src/models/integration-error.model.ts | 1 + src/util/error.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/models/integration-error.model.ts b/src/models/integration-error.model.ts index d1dc0601..a984a387 100644 --- a/src/models/integration-error.model.ts +++ b/src/models/integration-error.model.ts @@ -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", diff --git a/src/util/error.ts b/src/util/error.ts index 3044b86c..9e583209 100644 --- a/src/util/error.ts +++ b/src/util/error.ts @@ -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;