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

do not wrap exceptions when rethrowing #207

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

chris-martin
Copy link
Contributor

No description provided.

@chris-martin chris-martin requested a review from a team as a code owner October 19, 2024 07:19
@chris-martin chris-martin requested review from tomcarste and pbrisbin and removed request for a team and tomcarste October 19, 2024 07:19
@@ -97,25 +102,38 @@ try action = withFrozenCallStack $ Annotated.try action

tryJust
:: forall e b m a
. (Exception e, MonadCatch m, HasCallStack)
. (Exception e, MonadCatch m)
=> (e -> Maybe b)
-> m a
-- ^ Action to run
-> m (Either b a)
tryJust test action =
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't this have been written in terms of catchJust, so we only have to fix this bug once?

tryJust test action = catchJust test (Right <$> action) $ pure . Left

?

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