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

Variants of Result.Try which provide a finally #69

Open
NathanMagnus opened this issue Aug 6, 2019 · 2 comments
Open

Variants of Result.Try which provide a finally #69

NathanMagnus opened this issue Aug 6, 2019 · 2 comments

Comments

@NathanMagnus
Copy link
Contributor

NathanMagnus commented Aug 6, 2019

I want to do something along the lines of:

Result.Try(
  () => DoSomething(),
  ex => MapFailure(ex),
  () => Finally()
);
@JohannesMoersch
Copy link
Owner

This seems like a reasonable thing to add to me.

@RyanMarcotte
Copy link
Collaborator

The following would work

Result.Try(() => DoSomething(), exception => MapFailure(exception))
    .Do(_ => Finally(), _ => Finally())

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

3 participants