Skip to content

Add support for propagating errors#49

Merged
kmclarnon merged 1 commit intomasterfrom
km/add-prop-error
May 7, 2025
Merged

Add support for propagating errors#49
kmclarnon merged 1 commit intomasterfrom
km/add-prop-error

Conversation

@kmclarnon
Copy link
Member

I find myself writing

if (res.isError()) {
  return Result.error(res.unwrapErrOrElseThrow())
}

A decent amount if/when I have some early returns, and this new method is simpler and avoids the allocation

Also fixed a bunch of tests that weren't doing anything

Copy link
Member

@zklapow zklapow left a comment

Choose a reason for hiding this comment

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

LGTM

@kmclarnon kmclarnon merged commit d63f97c into master May 7, 2025
1 check passed
@kmclarnon kmclarnon deleted the km/add-prop-error branch May 7, 2025 20:51
@kmclarnon kmclarnon mentioned this pull request May 7, 2025
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.

2 participants