-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
404 doesn't throw an exception #1437
Comments
Hi @kuuuurt, thanks for the report. Yep, it should be the exception here. Probably we can have an integration with https://github.com/pdvrieze/xmlutil for XML |
Seems like it's just the |
What type of content do you receive from the call? The client validates a call only in call receiving. |
Some JSON data which I deserialize with Kotlinx serialization. This specific case happened when I had a wrong URL and I'm just getting this <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /my_invalid_url</pre>
</body>
</html> instead of the JSON string but when I have the correct URL and receive this:
It works as expected. I used |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
Ktor 1.2.4 - Client
Describe the bug
It seems that it doesn't catch 404's in an error
To Reproduce
And here's the
httpCall
wrapper:However, 404's just pass through this.
Here's the response from the server:
I'm thinking I should need to register an XML serializer? But I can't find anything in the documentation. If I'm missing something, please do point me in the right direction.
Many thanks!
Expected behavior
It should catch 404's as an error
The text was updated successfully, but these errors were encountered: