Effect.catchSome((e) => {
// Handle specific error type
if (e._tag === "adapters/InvalidApiKeyError") {
return Option.some(
Effect.fail(new InvalidExternalApiKeyError({ cause: e }))
);
}
// Let other errors fall through to catchAll
return Option.none();
}),
Effect.catchAll((e) => new InternalError({ cause: e }))
Effect.catchSome((e) => {
// Handle specific error type
if (e._tag === "adapters/InvalidApiKeyError") {
return Option.some(
Effect.fail(new InvalidExternalApiKeyError({ cause: e }))
);
}
// Let other errors fall through to catchAll
return Option.none();
}),
Effect.catchAll((e) => new InternalError({ cause: e }))