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

Improve rethrow logic #87

Closed
bopazyn opened this issue Feb 16, 2020 · 3 comments
Closed

Improve rethrow logic #87

bopazyn opened this issue Feb 16, 2020 · 3 comments

Comments

@bopazyn
Copy link
Contributor

bopazyn commented Feb 16, 2020

I am thinking of introducing two new methods for ProblemDetailsOptions class:

  • Rethrow<T>() where T:Exception
  • Rethrow<T>(Func<HttpContext, Boolean> predicate) where T:Exception

The logic would run before ShouldRethrowException.

@khellang
Copy link
Owner

Hmm, in that case, I think we should just remove ShouldRethrowException altogether (it hasn't shipped yet) as it would allow you to misconfigure the middleware.

@bopazyn
Copy link
Contributor Author

bopazyn commented Feb 17, 2020

You are right. Having both would ShouldRethrowException and Rethrow would introduce many errors because the logic isn't obvious.

I can preapare PR in few days.

Edit: #88

@bopazyn
Copy link
Contributor Author

bopazyn commented Feb 20, 2020

PR was successfully merged into master.

@bopazyn bopazyn closed this as completed Feb 20, 2020
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

2 participants