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

Throwing a Bad Request for all exceptions is misleading #52

Open
jeffijoe opened this issue Apr 14, 2015 · 1 comment
Open

Throwing a Bad Request for all exceptions is misleading #52

jeffijoe opened this issue Apr 14, 2015 · 1 comment

Comments

@jeffijoe
Copy link

Currently, when the Rest Client encounters an exception, it wraps it in a RestResponse with a Bad Request code.

This is misleading, especially since there are no sanity checks when adding Url segments or query strings (e.g. is the value null?). This results in exceptions that are not caused by the HTTP client itself, and so deserves to be wrapped in PortableRestException - or at least just be thrown as-is.

Offending code: https://github.com/advancedrei/PortableRest/blob/master/src/PortableRest/RestClient.cs#L193

@valdetero
Copy link

So I just spent the last few hours trying to figure out this exact issue. My entity changed and instead of giving me a serialization error, it gave me a bad request. I agree that this should be changed.

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