Skip to content

Commit

Permalink
Fixing error mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ecamellini committed Nov 20, 2024
1 parent 786143e commit db7cc5a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/delegation-process/src/utilities/errorMappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const createProducerDelegationErrorMapper = (
.with(
"tenantIsNotIPAError",
"tenantNotAllowedToDelegation",
"differentEserviceProducer",
() => HTTP_STATUS_FORBIDDEN
)
.with("delegationAlreadyExists", () => HTTP_STATUS_CONFLICT)
Expand All @@ -55,7 +56,11 @@ export const createConsumerDelegationErrorMapper = (
"delegatorAndDelegateSameId",
() => HTTP_STATUS_BAD_REQUEST
)
.with("tenantNotAllowedToDelegation", () => HTTP_STATUS_FORBIDDEN)
.with(
"tenantIsNotIPAError",
"tenantNotAllowedToDelegation",
() => HTTP_STATUS_FORBIDDEN
)
.with("delegationAlreadyExists", () => HTTP_STATUS_CONFLICT)
.otherwise(() => HTTP_STATUS_INTERNAL_SERVER_ERROR);

Expand Down

0 comments on commit db7cc5a

Please sign in to comment.