FreeHEP API
Version v1.2

org.freehep.util
Interface HasNestedException

All Known Implementing Classes:
BadXMLException, NestedException, NestedRuntimeException

public interface HasNestedException

An interface implemented by some exceptions to indicate that they have an additional exception nested inside of them. This is very useful in order to be able to add extra information to an exception without losing the original information. For example:

       try
       {
            readFile(fileName);
       }
       catch (IOException x)
       {
            throw new NestedException("Error while reading "+fileName,x);
       }
 

Version:
$Id: HasNestedException.java,v 1.2 2002/06/12 23:15:16 duns Exp $
Author:
Tony Johnson

Method Summary
 String getMessage()
          Get the message text, including the message text if the nested exception
 Throwable getNestedException()
          Get the exception nested inside
 String getSimpleMessage()
          Get the message text, without the message text of the nested exception
 

Method Detail

getNestedException

public Throwable getNestedException()
Get the exception nested inside

Returns:
The nested exception

getSimpleMessage

public String getSimpleMessage()
Get the message text, without the message text of the nested exception

Returns:
The message corresponding to this exception

getMessage

public String getMessage()
Get the message text, including the message text if the nested exception

Returns:
The message corresponding to this exception

FreeHEP API
Version v1.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.