org.palo.api
Class PaloAPIException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.palo.api.PaloAPIException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
InsufficientRightsException, PaloObjectNotFoundException

public class PaloAPIException
extends java.lang.RuntimeException

PaloException

All operations of the PALO-API in this package potentially throw this exception or other runtime exceptions.

It is best practise to anticipated these exceptions where appropriate. Since checked-exceptions don't scale well and force the clients to write a lot of catch blocks, the PaloAPIException is unchecked.

Version:
$ID$
See Also:
Serialized Form

Constructor Summary
PaloAPIException(java.lang.String msg)
          Constructs a new PaloAPIException
PaloAPIException(java.lang.String msg, java.lang.Throwable cause)
          Constructs a new PaloAPIException
PaloAPIException(java.lang.Throwable cause)
           
 
Method Summary
 java.lang.Object getData()
          Returns the optional set data object or null if none was set.
 java.lang.String getDescription()
          Returns an optional error description.
 java.lang.String getErrorCode()
          Returns an optional error code or null if none was defined
 java.lang.String getReason()
          Returns an optional description of the error cause.
 void setData(java.lang.Object data)
          Sets an optional data object.
 
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

PaloAPIException

public PaloAPIException(java.lang.String msg)
Constructs a new PaloAPIException

Parameters:
msg - the message for the exception.

PaloAPIException

public PaloAPIException(java.lang.String msg,
                        java.lang.Throwable cause)
Constructs a new PaloAPIException

Parameters:
msg - the message for the exception.
cause - the nested exception.

PaloAPIException

public PaloAPIException(java.lang.Throwable cause)
Method Detail

getErrorCode

public final java.lang.String getErrorCode()
Returns an optional error code or null if none was defined

Returns:
error code or null

getDescription

public final java.lang.String getDescription()
Returns an optional error description. If no description was defined then calling this method has the same effect as calling Throwable.getMessage()

Returns:
an optional error description

getReason

public final java.lang.String getReason()
Returns an optional description of the error cause. If no reason was defined then calling this method has same effect as calling getDescription()

Returns:
an optional error reason

setData

public final void setData(java.lang.Object data)
Sets an optional data object. The type of the data object and if it is set at all depends on the context in which this exception is thrown.

Parameters:
data - an optional data object or null

getData

public final java.lang.Object getData()
Returns the optional set data object or null if none was set.

Returns:
the data object or null