01: package net.matuschek.spider;
02:
03: import java.net.URL;
04:
05: /**
06: * InterruptProcessingRobotExceptionHandler
07: * This is a concrete ExceptionHandler, which interupts the processing robot
08: * by throwing a runtime exception.
09: * <p>
10: * @author cn
11: * @version 0.1
12: */
13: public class InterruptProcessingRobotExceptionHandler implements
14: RobotExceptionHandler {
15:
16: /**
17: * This exception handler throws a runtime exception with the message of the
18: * incoming exception.
19: * @see RobotExceptionHandler#handleException(WebRobot, URL, Exception)
20: */
21: public void handleException(WebRobot robot, URL url, Exception e) {
22: String errorMessage = e.getMessage();
23: //System.out.println("ERROR: " + errorMessage);
24: //robot.stopRobot();
25: throw new RuntimeException(errorMessage);
26: }
27:
28: }
|