1

What Exception is thrown on connection timeout in HTMLUnit ?

Oded
  • 489,969
  • 99
  • 883
  • 1,009
oneat
  • 10,778
  • 16
  • 52
  • 70

2 Answers2

2

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.

Ben Flynn
  • 18,524
  • 20
  • 97
  • 142
1

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

Community
  • 1
  • 1
metoo
  • 41
  • 1
  • 4