org.mycore.common
Class MCRException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.mycore.common.MCRException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FilterPluginInstantiationException, FilterPluginTransformException, MCRConfigurationException, MCRParseException, MCRPersistenceException, MCRUsageException

public class MCRException
extends RuntimeException

Instances of this class represent a general exception thrown by any part of the MyCoRe implementation classes.

Version:
$Revision: 13085 $ $Date: 2008-02-06 18:27:24 +0100 (Mi, 06 Feb 2008) $
Author:
Jens Kupferschmidt, Frank Lützenkirchen
See Also:
RuntimeException, Serialized Form

Field Summary
protected  Exception exception
          the embedded exception that was thrown by an underlying system
 
Constructor Summary
MCRException(String message)
          Creates a new MCRException with an error message
MCRException(String message, Exception exception)
          Creates a new MCRException with an error message and a reference to an exception thrown by an underlying system.
 
Method Summary
 Exception getException()
          Returns the exception thrown by an underlying system
 String getStackTraceAsString()
          Returns a String containing the invocation stack trace for this exception
static String getStackTraceAsString(Throwable ex)
          Returns a String containing the invocation stack trace of an exception
 String toString()
          Returns a String representation of this exception and all its properties
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

exception

protected Exception exception
the embedded exception that was thrown by an underlying system

Constructor Detail

MCRException

public MCRException(String message)
Creates a new MCRException with an error message

Parameters:
message - the error message for this exception

MCRException

public MCRException(String message,
                    Exception exception)
Creates a new MCRException with an error message and a reference to an exception thrown by an underlying system. Normally, this exception will be the cause why we would throw an MCRException, e. g. when something in the datastore goes wrong.

Parameters:
message - the error message for this exception
exception - the exception that was thrown by an underlying system
Method Detail

getException

public Exception getException()
Returns the exception thrown by an underlying system

Returns:
the exception thrown by an underlying system

getStackTraceAsString

public String getStackTraceAsString()
Returns a String containing the invocation stack trace for this exception

Returns:
a String containing the invocation stack trace for this exception

getStackTraceAsString

public static String getStackTraceAsString(Throwable ex)
Returns a String containing the invocation stack trace of an exception

Parameters:
ex - the exception you want the stack trace of
Returns:
the invocation stack trace of an exception

toString

public String toString()
Returns a String representation of this exception and all its properties

Overrides:
toString in class Throwable
Returns:
a String representation of this exception and all its properties