-
-
Notifications
You must be signed in to change notification settings - Fork 387
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
Missing info in the "Call failed with status code" error message (FlurlHttpException) #841
Comments
Hmm. It seems impossible that Flurl is constructing that message. Here's the only line in the entire code base where Flurl builds a message resembling that: https://github.com/tmenier/Flurl/blob/dev/src/Flurl.Http/FlurlHttpException.cs#L42 Note that |
Oh, it's not |
I checked the source and it looks like the return $"Call failed with status code {call.Response.StatusCode} ({call.HttpResponseMessage.ReasonPhrase}): {call}"; |
I think I got it. The REST endpoint I'm calling must not be returning the
it would return:
|
I was hoping that we can fix the web server response and return the appropriate reason phrase, but it does not seem to be feasible, since we're using a third party app and we have no control of the server responses. You would not believe the crap that app returns in the response (like, an HTML error page without the closing HTML tag), so I am not surprised that they do not include the reason phrase. And unfortunately, there is nothing we can do to fix it, so if there were a way to either not include empty parentheses or add the default reason value, it would make the error messages in the |
Haha, ok I'll keep this open. I like your idea of falling back on the enum value, should be simple and I'll get it on my near-term radar. |
When making a call to the existing endpoint for a non-supported operation (e.g. PATCH), the
Message
property of theFlurlHttpException
has the following format:Is there something supposed to be inside of parentheses? Should it be the text value of the HTTP status code, like:
It seems to be the issue with other status calls, as well, not just with 405.
The text was updated successfully, but these errors were encountered: