-
Notifications
You must be signed in to change notification settings - Fork 110
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
Added ProblemDetailsException constructors #78
Conversation
Sure, but I'm not sure the |
I think that from a usability perspective the enum version really helps, just type Willing to reconsider? otherwise I'll go ahead and update the pr |
Yes and no. Fundamentally, HTTP status codes isn't a closed set, so using enums is kinda problematic. (Yes, I know .NET enums aren't technically closed sets, but I don't consider I'd like to keep the code based aligned with what ASP.NET Core is doing, and they're using I've pushed for using alternatives many many times, starting around 4-5 years ago (see aspnet/HttpAbstractions#345 (comment)), but I'm afraid that ship has sailed. |
I agree with you that an enum might be problematic, that's why I also added overloads taking an int. |
esed a temporary editorconfig file, the real one will be merged from master
Are you expecting anything else from me on this one? |
Nope. Thanks for the contribution! ❤️ |
this set of constructors makes to code for throwing exceptions that translates into a status code response a little more terse and easier to read/write
for example:
vs
would you be willing to accept this?