-
Notifications
You must be signed in to change notification settings - Fork 58
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
coro-http does not generate error nor returns when remote immediately closes the connection #217
Comments
There is a bit of a descrepency between how errors are handled between some of the coro packages. Some return nil, err, some throw the error. Changing this now may break things, though. HTTP responses are a little different though since the code and reason are in the response metadata table. Depending upon the server, you may also get more information in the response body. |
I like the |
I agree, I prefer that style. Some discrepancies I am referring to are:
|
I'd be fine with PRs making it more consistent. We can bump major versions if it's a breaking change. |
I'll see what I can do then. It'll take some time to deconstruct everything, but it shouldn't be too challenging. |
When doing a HTTP request with coro-http and the remote immediately closes the connection without a response the coroutine never returns, ideally it should throw an error.
Test exampe:
In the above example because we are forcing connecting to port 443 (the https port) while using HTTP protocol the remote will imediatelly close the connection because of invalid protocol.
When running with luvit the above example ends with no messages, it should print the error instead.
The text was updated successfully, but these errors were encountered: