.pipe(
Effect.catchTag(
"NoSuchElementException",
() =>
new ProductNotFoundError({
message: `Product ${dto.id} was not found.`,
}),
),
Effect.catchAll(
(cause) =>
new GenericError({
cause,
}),
)
)
.pipe(
Effect.catchTag(
"NoSuchElementException",
() =>
new ProductNotFoundError({
message: `Product ${dto.id} was not found.`,
}),
),
Effect.catchAll(
(cause) =>
new GenericError({
cause,
}),
)
)