I want my crawler to wait for 5 minutes if it gets a SocketConnectException(i.e. if the internet connection is down) and resume again and also maybe send a mail to an admin about this. I have seen the source code, and the methods that throw this exception are private, so I cannot overload them. Is there any other option to handle this exception other than changing the source code? Thanks.
Asked
Active
Viewed 98 times
1
-
I don't think it's possible, because the only thing I can think of at this point is to catch the exception somewhere higher, and trigger another crawler from the last url of killed crawler, which I think this may lead back to pages you already visited. – pnadczuk Jun 02 '15 at 07:34
1 Answers
0
Yes, it can now be achieved.
One of the recent (from the end of July 2015) commits fixed it.
Please override: onUnhandledException(.. Throwable ex)
On that overriden method you can compare the class of ex to SocketConnect...Exception and do whatever you want there.

Chaiavi
- 769
- 9
- 23