问题
What Exception is thrown on connection timeout in HTMLUnit ?
回答1:
HtmlUnit uses the Apache HttpClient. The timeout mechanism throws an InterruptedIOException.
See the HttpClient documentation.
This exception is a subclass of IOException, which can be thrown during any HttpClient execute call (basically whenever you get a page with an HtmlUnit WebClient.
回答2:
I think there is a bug, it really should throw a exception but dont throw if you set an timeout great than a value, you can see it in (Call getPage from htmlunit WebClient with JavaScript disabled and setTimeout set to 10000 waits forever)
Thanks a lot
来源:https://stackoverflow.com/questions/3690358/what-exception-is-thrown-on-timeout