简体   繁体   English

超时引发什么异常?

[英]What Exception is thrown on timeout?

HTMLUnit中的连接超时引发什么异常?

HtmlUnit uses the Apache HttpClient. HtmlUnit使用Apache HttpClient。 The timeout mechanism throws an InterruptedIOException . 超时机制引发InterruptedIOException

See the HttpClient documentation . 请参阅HttpClient文档

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. 此异常是IOException的子类,可以在任何HttpClient执行调用期间抛出该异常(基本上在获取带有HtmlUnit WebClient的页面时基本如此)。

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 ) 从禁用了JavaScript且将setTimeout设置为10000的htmlunit WebClient调用getPage永远等待

Thanks a lot 非常感谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM