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

Add SeekTo.fail affordance #887

Merged
merged 2 commits into from
May 8, 2024
Merged

Add SeekTo.fail affordance #887

merged 2 commits into from
May 8, 2024

Conversation

amohrland
Copy link
Collaborator

@amohrland amohrland commented May 8, 2024

KAYAK-3710 Add SeekTo.fail affordance. Sometimes we seek to succeed; sometimes we seek to fail.

@amohrland amohrland requested a review from a team as a code owner May 8, 2024 20:23
@amohrland
Copy link
Collaborator Author

Breaking change; will need to be a 6-series milestone.

@@ -147,6 +156,9 @@ object SeekTo {

def end: SeekTo = Impl(List.empty, FinalFallback.end)

def fail(throwable: Throwable): SeekTo =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it worth having two fail methods?

final case class PathologicalSeekTo() extends RuntimeException("You shall not pass!")

def failWith(throwable: Throwable): SeekTo =
  Impl(List.empty, FinalFallback.fail(throwable))

def fail: SeekTo =
  failWith(PathologicalSeekTo())

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I avoided this to avoid having to pick a name, but you've forced my hand 😄

@amohrland amohrland merged commit b19e02d into main May 8, 2024
11 checks passed
@amohrland amohrland deleted the seekto-fail branch May 8, 2024 21:04
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.

3 participants