[jboss-user] [JBoss Seam] - noobie->how to write custom exception

Stateless Bean do-not-reply at jboss.com
Tue Oct 16 09:30:51 EDT 2007


Hi,
Can anyone tell me how to write my custom exception handler class?

here is my seam methow

  | public void myMethod() {
  |     	try {
  | 
  | 		}
  | 		catch (MyException e) {
  | 
  | 		}
  | 	}

and my class

  | public class MyException extends Exception {
  | 
  | 	   public MyException (String message)
  | 	   {
  | 	      super(message);
  | 	      System.out.println("ok");
  | 	   }	
  | 	   
  |    
  | }

but i get error:
anonymous wrote : 
  | Unreachable catch block for MyException . This exception is never thrown from the try 
  |  statement body

what should I do?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095611#4095611

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095611



More information about the jboss-user mailing list