vert.x
vert.x copied to clipboard
More specific exceptions for exceeded socket timeouts
Describe the feature
It's common to get a Socket Closed exception when exceeding various timeouts (connection timeout, idle timeout, read timeout, write timeout). In my experience it can be frustrating to figure out where these errors are coming from because the stack trace is pruned for performance reasons. Can we switch these out for more specific exceptions to let users know why the socket was closed and what kind of socket timed out?
Ex. SocketConnectionTimeoutException("Server Socket connection timed out after X seconds")
and SocketIdleTimeoutException("Http Client Socket timed out from no read/write activity after X seconds")
Use cases
Help users debug cases where default timeouts aren't long enough for their use-cases. Or where timeouts have been improperly configured
Contribution
I may be able to implement this with some direction.
I agree we should have better reporting, however I believe the error message should be enough rather than introducing a specific java class for every king of possible timeout.