Skip to content

[Feature] Expose a public ThrowHelper type #3322

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

Closed
john-h-k opened this issue Jun 4, 2020 · 3 comments · Fixed by #3346
Closed

[Feature] Expose a public ThrowHelper type #3322

john-h-k opened this issue Jun 4, 2020 · 3 comments · Fixed by #3346
Labels
feature request 📬 A request for new changes to improve functionality improvements ✨
Milestone

Comments

@john-h-k
Copy link
Contributor

john-h-k commented Jun 4, 2020

Describe the problem this feature would solve

Currently, the Guard API is suitable for parameter validation but nothing more, and consumers still likely need a ThrowHelper type for other sorts of exceptions

Describe the solution

Expose a public ThrowHelper type (the current one internal) that provides throwing methods for a wider variety of types. The basic layout of each method would be

[DoesNotReturn]
public void ThrowFooException(string? message = null, Exception inner? = null)
{
    throw new FooException(message, inner);
}

With different params for exceptions with special ctors

@john-h-k john-h-k added the feature request 📬 A request for new changes to improve functionality label Jun 4, 2020
@ghost
Copy link

ghost commented Jun 4, 2020

Hello, 'john-h-k! Thanks for submitting a new feature request. I've automatically added a vote 👍 reaction to help get things started. Other community members can vote to help us prioritize this feature in the future!

@john-h-k
Copy link
Contributor Author

john-h-k commented Jun 4, 2020

cc @Sergio0694

@Sergio0694 Sergio0694 linked a pull request Sep 21, 2020 that will close this issue
7 tasks
@Sergio0694 Sergio0694 added this to the 7.0 milestone Sep 21, 2020
@Sergio0694
Copy link
Member

Forgot to update/close this issue, this feature has now been added in #3346 😄🚀

@ghost ghost locked as resolved and limited conversation to collaborators Nov 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request 📬 A request for new changes to improve functionality improvements ✨
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants