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

Make accept() throw more useful errors #7822

Merged
merged 1 commit into from
Aug 4, 2014
Merged

Conversation

staticfloat
Copy link
Member

No description provided.

@@ -862,7 +862,7 @@ function accept(server::UVServer, client::AsyncStream)
end
stream_wait(server,server.connectnotify)
end
error("server was closed while attempting to accept a client")
uv_error("accept", UV_ECONNABORTED)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This calls into question what uv_error really means. After all, this error is not returned by libuv. I also generally dislike classifying errors according to which library threw them, but that's not specific to this PR of course.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only reason libuv isn't returning this error is because we explicitly check on the julia side for the condition that would cause libuv to return this error. If we didn't have that isopen(server) check, this is the error that would be raised by libuv.

I guess we could just map this to a SystemError instead, which I would have done, except that I wanted to be consistent with the rest of our socket/IO code. I guess we could just create an IOError type that holds the UV_* codes instead (which are really just errno codes anyway).

JeffBezanson added a commit that referenced this pull request Aug 4, 2014
Make accept() throw more useful errors
@JeffBezanson JeffBezanson merged commit dba572b into master Aug 4, 2014
@staticfloat
Copy link
Member Author

Amazing how the seemingly smallest of changes always provoke the most intense of discussions.

@staticfloat staticfloat deleted the sf/accepterrors branch August 6, 2014 19:04
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

Successfully merging this pull request may close these issues.

2 participants