Skip to content

docs(effect): fix direct-call error-handling example to use safe() - #1997

Closed
Mnigos wants to merge 1 commit into
middleapi:mainfrom
Mnigos:effect-docs-safe-call-example
Closed

docs(effect): fix direct-call error-handling example to use safe()#1997
Mnigos wants to merge 1 commit into
middleapi:mainfrom
Mnigos:effect-docs-safe-call-example

Conversation

@Mnigos

@Mnigos Mnigos commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

The "Typesafe Errors" example in the Effect integration guide destructures the result of call(procedure) as a tuple:

const [error, result] = await call(procedure)

call returns the output directly (or throws), so as written the error path never reaches isInferableError and the success path destructures the string 'Success'. Switched to await safe(call(procedure)), matching the safe idiom used elsewhere in the docs.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Effect docs: fix direct-call error-handling example — In apps/content/docs/integrations/effect.mdx, changed const [error, result] = await call(procedure) to const [error, data] = await safe(call(procedure)). This is correct: call returns the output directly (or throws), so the old tuple destructuring could never yield an error for isInferableError; wrapping with safe returns [error, data], matching the established idiom in the tanstack-query and pinia-colada docs.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Mnigos

Mnigos commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #1987, which rewrote this example and already uses safe(call(procedure)). Closing.

@Mnigos Mnigos closed this Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant