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

In case of Enum, OutOfRange should throw InvalidEnumArgumentException #66

Closed
elendil-software opened this issue May 13, 2020 · 5 comments · Fixed by #78
Closed

In case of Enum, OutOfRange should throw InvalidEnumArgumentException #66

elendil-software opened this issue May 13, 2020 · 5 comments · Fixed by #78

Comments

@elendil-software
Copy link
Contributor

Hi,

In the case of an enum, OutOfRange should throw an InvalidEnumArgumentException instead of an ArgumentOutOfRangeException

What do you think ?

@elendil-software elendil-software changed the title In case of Enum OutOfRange should throw InvalidEnumArgumentException In case of Enum, OutOfRange should throw InvalidEnumArgumentException May 13, 2020
@ardalis
Copy link
Owner

ardalis commented May 14, 2020

Agreed. You want to make a pull request, @elendil-software ?

@elendil-software
Copy link
Contributor Author

There is a problem, this exception does not exist in .NET Standard 1.1 : https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.invalidenumargumentexception?view=netcore-3.1&viewFallbackFrom=netstandard-1.1
I don't think it will be possible to do the change.

@ardalis
Copy link
Owner

ardalis commented Jul 22, 2020

Ok maybe this is something we can target for a 3.0 release, which can depend on a higher version of netstandard.

@ShadyNagy
Copy link
Contributor

PR -> #78

@ardalis
Copy link
Owner

ardalis commented Aug 20, 2020

This is in v3.0.0 since it's a breaking change: https://www.nuget.org/packages/Ardalis.GuardClauses/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants