What Exception is thrown on timeout?

萝らか妹 提交于 2020-01-14 03:56:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!