Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From Discord: Understanding Stream.orDie in Effect Typescript #4356

Open
effect-bot opened this issue Jan 28, 2025 · 0 comments
Open

From Discord: Understanding Stream.orDie in Effect Typescript #4356

effect-bot opened this issue Jan 28, 2025 · 0 comments

Comments

@effect-bot
Copy link

Summary

In the chat, the user is discussing an issue they are experiencing with the Stream.orDie function in Effect Typescript. They provide a code example to illustrate their misunderstanding or possible bug: they expect Stream.orDie to convert errors into defects, but it seems to still return the original error instead of causing a defect. The user notes that using Stream.onError(Effect.die) achieves their desired outcome, where the application is expected to crash on error.

Key takeaways:

  • The user expects Stream.orDie to create a defect from an error, but it appears not to function as anticipated.
  • There may be a potential bug in Stream.orDie.
  • The user's workaround involves using Stream.onError(Effect.die) to achieve the expected behavior.
  • Another user, possibly a maintainer or experienced user, confirms it seems like a bug.

Discord thread

https://discord.com/channels/795981131316985866/1333431564943495219

arijoon added a commit to arijoon/effect that referenced this issue Jan 28, 2025
Added tests for issue Effect-TS#4356

Effectful failures or not handled by the orDie

TODO: Add stream error from asyncIterator generator as well since that won't be caught either
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

No branches or pull requests

1 participant