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

use TimeoutException for timeout #1995

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

sukovanej
Copy link
Contributor

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

I was staring at a failing test shouting NoSuchElementException at me and it took me some time to realise it is actually a timeout.

While I somewhat get the point that being able to easily convert such an error to Option using Effect.optionFromOptional is convenient, I believe it is quite confusing. In such a case using explicit Effect.catchTag("TimeoutException", () => Effect.succeedNone) and communicating clearly what's happening to a reader of my code is IMHO better.

Copy link

changeset-bot bot commented Jan 26, 2024

🦋 Changeset detected

Latest commit: 6b7e812

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
effect Minor
@effect/cli Major
@effect/experimental Major
@effect/opentelemetry Major
@effect/platform-browser Major
@effect/platform-bun Major
@effect/platform-node Major
@effect/platform Major
@effect/printer-ansi Major
@effect/printer Major
@effect/rpc-http-node Major
@effect/rpc-http Major
@effect/rpc-nextjs Major
@effect/rpc-workers Major
@effect/rpc Major
@effect/schema Major
@effect/typeclass Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot changed the base branch from main to next-minor January 26, 2024 20:35
@sukovanej sukovanej force-pushed the timeout-exception branch 2 times, most recently from 2c199af to ccf1e1d Compare January 29, 2024 09:00
Copy link
Member

@IMax153 IMax153 left a comment

Choose a reason for hiding this comment

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

I personally like this change. Though it limits the use of optionFromOptional for handling timeout errors, I feel as though the explicitness is much better.

Will wait for @mikearnaldi and @tim-smart to also weigh in.

@tim-smart tim-smart merged commit 5a18e50 into Effect-TS:next-minor Jan 29, 2024
9 checks passed
@github-actions github-actions bot mentioned this pull request Jan 29, 2024
github-actions bot pushed a commit that referenced this pull request Jan 29, 2024
github-actions bot pushed a commit that referenced this pull request Jan 29, 2024
github-actions bot pushed a commit that referenced this pull request Jan 29, 2024
github-actions bot pushed a commit that referenced this pull request Jan 30, 2024
github-actions bot pushed a commit that referenced this pull request Jan 30, 2024
github-actions bot pushed a commit that referenced this pull request Jan 30, 2024
github-actions bot pushed a commit that referenced this pull request Jan 30, 2024
github-actions bot pushed a commit that referenced this pull request Jan 30, 2024
github-actions bot pushed a commit that referenced this pull request Jan 30, 2024
github-actions bot pushed a commit that referenced this pull request Jan 30, 2024
github-actions bot pushed a commit that referenced this pull request Jan 31, 2024
github-actions bot pushed a commit that referenced this pull request Feb 3, 2024
github-actions bot pushed a commit that referenced this pull request Feb 4, 2024
github-actions bot pushed a commit that referenced this pull request Feb 4, 2024
github-actions bot pushed a commit that referenced this pull request Feb 4, 2024
github-actions bot pushed a commit that referenced this pull request Feb 4, 2024
github-actions bot pushed a commit that referenced this pull request Feb 5, 2024
gcanti pushed a commit that referenced this pull request Feb 5, 2024
tim-smart pushed a commit that referenced this pull request Feb 6, 2024
github-actions bot pushed a commit that referenced this pull request Feb 6, 2024
github-actions bot pushed a commit that referenced this pull request Feb 7, 2024
tim-smart pushed a commit that referenced this pull request Feb 7, 2024
github-actions bot pushed a commit that referenced this pull request Feb 7, 2024
github-actions bot pushed a commit that referenced this pull request Feb 7, 2024
github-actions bot pushed a commit that referenced this pull request Feb 7, 2024
tim-smart pushed a commit that referenced this pull request Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants