Version: 1.1.1

org.biomoby.shared
Class MobyException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.biomoby.shared.MobyException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ServiceException

public class MobyException
extends Exception

A general exception which can be used as a wrapper around other exceptions. Using this exception simplifies the code (but on the other hand it makes it less "type-safe" - which is usually not a problem when dealing with exceptions).

Version:
$Id: MobyException.java,v 1.5 2008/03/02 12:45:26 senger Exp $
Author:
Martin Senger
See Also:
Serialized Form

Constructor Summary
MobyException()
           
MobyException(String s)
          A constructor specifying a reason for this exception.
MobyException(String s, Throwable e)
          A constructor used for storing another exception in MobyException.
 
Method Summary
static void formatAndLog(Throwable e, org.apache.commons.logging.Log log)
          Format given exception 'e' depending on how serious it it.
 Throwable getOriginalException()
          Deprecated. Use instead getCause() directly.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MobyException

public MobyException()

MobyException

public MobyException(String s)
A constructor specifying a reason for this exception.

Parameters:
s - message/reason

MobyException

public MobyException(String s,
                     Throwable e)
A constructor used for storing another exception in MobyException. It allows access to the original (wrapped) exception and its message.

Parameters:
s - message (or reason of)
e - original cause of this exception
Method Detail

getOriginalException

public Throwable getOriginalException()
Deprecated. Use instead getCause() directly.

Retrieve the original exception.

Returns:
an original exception which was wrapped by this BiomonyException, or null if there was no original exception involved

formatAndLog

public static void formatAndLog(Throwable e,
                                org.apache.commons.logging.Log log)
Format given exception 'e' depending on how serious it it. In same cases add stack trace. Log the result in the given 'log'.

Parameters:
e - an exception to be formatted and logged
log - where to log it

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010