Effect.catchTag like any other Effect.
Typed failures in handlers
Define your failures withSchema.TaggedError and fail with yield*:
src/tracker.ts
tracker.move without handling it can fail with TaskLocked. So can a
generator that runs return yield* new TaskLocked({ id }).
What a failure does
A failure you don’t handle, or a defect, fails the piece. Its details stay in your process: the SDK answers Reintersect with a generic message, such asAction "move" failed., and nothing from your
error’s fields.
Turn a failure into an answer
When the member should know what went wrong, catch the failure and return a result. In an action, that’s a notice, and the block keeps its state:src/moveTask.ts
fieldErrors for form validation the schema can’t express, and Effect.catchTags to handle
several tags at once. In a command or message action, return a notice in the same way. A danger or
warning notice on its own ends the run as failed and shows your text on the failure card.
Errors from the client
The client’s methods put the Reintersect API’s errors in the error channel, so they show up in your handler’s type until you handle them:@reintersect/sdk/effect, such as
ReintersectBlocksUpdateError. A union holds:
- The endpoint’s API errors, such as
ReintersectAppBlockVersionConflictError,ReintersectAppBlockNotFoundErrororReintersectAppInteractionExpiredError. The error reference lists every tag with its status and fields. - Transport errors:
ReintersectSdkNetworkError,ReintersectSdkTimeoutError,ReintersectSdkInvalidResponseErrorandReintersectSdkInvalidInputError. - Token errors, when the client mints its own install token:
ReintersectAppInstallTokenError,ReintersectAppConfigurationError,ReintersectAppInstallNotFoundError,ReintersectAppInstallRevokedErrorandReintersectApiRateLimitExceededError.
ReintersectSdkInvalidInputError before any request, and state that comes back without
decoding fails with ReintersectSdkInvalidResponseError.
Reads (get, query and revalidate) are retried twice with jittered backoff on network errors,
timeouts and 503. Writes run once. To retry a write, compose Effect.retry with a bounded,
jittered schedule yourself, and only where running it twice is safe, such as an update with
expectedVersion.
Errors in a delivery
These errors describe a delivery that the SDK couldn’t run. They’re exported from@reintersect/sdk/effect/app and become the delivery’s response. They aren’t in your handlers’
error channels.
The testing kit raises its own tagged errors, such as
ReintersectTestControlMissingError, so a test can assert on a failure.