public boolean checkException (ChainException e, 
				 String expectedException) {

    boolean notCaught = true;
    while (true) {
      
      String exception = e.getClass().getName();
      
      if (exception.equals(expectedException)) {
	return (!notCaught);
      }
      
      if ( e.prev==null ) {
	return notCaught;
      }
      e = (ChainException)e.prev;
    }
    
  } // end of checkException