KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > matuschek > spider > InterruptProcessingRobotExceptionHandler


1 package net.matuschek.spider;
2
3 import java.net.URL JavaDoc;
4
5
6 /**
7  * InterruptProcessingRobotExceptionHandler
8  * This is a concrete ExceptionHandler, which interupts the processing robot
9  * by throwing a runtime exception.
10  * <p>
11  * @author cn
12  * @version 0.1
13  */

14 public class InterruptProcessingRobotExceptionHandler implements 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 JavaDoc url, Exception JavaDoc e) {
22         String JavaDoc errorMessage = e.getMessage();
23         //System.out.println("ERROR: " + errorMessage);
24
//robot.stopRobot();
25
throw new RuntimeException JavaDoc(errorMessage);
26     }
27
28 }
29
Popular Tags