|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
raccoon.api.exception.RaccoonException
public class RaccoonException
The base exception for all Raccoon exception, all exceptions inherit from this exception.
Field Summary | |
---|---|
static int |
MAX_MESSAGE_LENGTH
The maximum line length of a message. |
static int |
MAX_MSG_SIZE
The maximum number of characters for given line. |
static int |
MAX_STACK_DEPTH
The number of stacks of the contained exceptions printed out in the toString method. |
static java.lang.String |
MESSAGE_TOO_LONG
A string indicating a too long message to display. |
Constructor Summary | |
---|---|
RaccoonException()
Constructs a RaccoonException with no specified detail message. |
|
RaccoonException(int pErrorCode,
java.lang.String pMessage)
Contructs a RaccoonException with the specified error code and detail message. |
|
RaccoonException(int pErrorCode,
java.lang.String pMessage,
java.lang.Throwable pThrowable)
Constructs a RaccoonException with the specified error code, detail message and nested exception. |
|
RaccoonException(java.lang.String pMessage)
Constructs a RaccoonException with the specified detail message. |
|
RaccoonException(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Constructs a RaccoonException with the specified detail message and nested exception. |
Method Summary | |
---|---|
void |
addContainedException(java.lang.Throwable pThrowable)
Adds an exception to this instance, useful when more than one nested exception is required. |
static java.lang.String |
buildString(java.lang.Throwable pThrowable,
java.lang.String pOffSet)
Generates a string containing the stacktrace of the throwable. |
java.lang.Throwable |
getContainedException(int pPosition)
Retrieves the element from the collection containedExceptions at the specified index. |
java.util.ArrayList |
getContainedExceptions()
All the exceptions carried by this instance. |
int |
getContainedExceptionsSize()
Retrieves the number of elements within the collection containedExceptions . |
int |
getErrorCode()
Convenience method for retrieving the component error code of this instance. |
java.lang.String |
getErrorMessage()
Use this method to retrieve the error carried by this instance and not all the error messages. |
java.lang.String |
getMessage()
Returns the detail message, including the message from the nested exception if there is one. |
java.util.Iterator |
iterContainedExceptions()
Iterator on the elements within the collection containedExceptions . |
java.lang.String |
printStackTraceAsString()
Generates a String representation of the StackTrace. |
void |
setContainedException(int pPosition,
java.lang.Throwable pThrowable)
Defines the element from the collection containedExceptions at the specified index. |
void |
setContainedExceptions(java.util.ArrayList pContainedExceptions)
Defines all the exceptions that this instance should carry. |
void |
setErrorCode(int pErrorCode)
Defines the error code associated to this instance. |
void |
setErrorMessage(java.lang.String pErrorMessage)
Defines the error message associated to this exception, it doesn't impact the nested exceptions. |
java.lang.String |
toString()
Returns a short description of this throwable. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, 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 |
---|
public static final int MAX_STACK_DEPTH
public static final java.lang.String MESSAGE_TOO_LONG
public static final int MAX_MSG_SIZE
public static final int MAX_MESSAGE_LENGTH
Constructor Detail |
---|
public RaccoonException()
RaccoonException
with no specified detail message.
public RaccoonException(java.lang.String pMessage)
RaccoonException
with the specified detail message.
pMessage
- the detail messagepublic RaccoonException(java.lang.String pMessage, java.lang.Throwable pThrowable)
RaccoonException
with the specified detail message and nested exception.
pMessage
- the detail messagepThrowable
- the nested exceptionpublic RaccoonException(int pErrorCode, java.lang.String pMessage)
RaccoonException
with the specified error code and detail message.
pErrorCode
- the error codepMessage
- the detail messagepublic RaccoonException(int pErrorCode, java.lang.String pMessage, java.lang.Throwable pThrowable)
RaccoonException
with the specified error code, detail message and nested exception.
pErrorCode
- the error codepMessage
- the detail messagepThrowable
- the nested exceptionMethod Detail |
---|
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public java.lang.String getErrorMessage()
getMessage
returns the full stack
trace.
public void setErrorMessage(java.lang.String pErrorMessage)
pErrorMessage
- the error message.public java.lang.String printStackTraceAsString()
stderr
public int getErrorCode()
public void setErrorCode(int pErrorCode)
pErrorCode
- the error code, a value of ComponentError
public java.util.ArrayList getContainedExceptions()
Throwable
public void setContainedExceptions(java.util.ArrayList pContainedExceptions)
pContainedExceptions
- a vector of Throwable
public void addContainedException(java.lang.Throwable pThrowable)
pThrowable
- the nested exceptionpublic java.lang.Throwable getContainedException(int pPosition) throws java.lang.ArrayIndexOutOfBoundsException
containedExceptions
at the specified index.
pPosition
- index of the desired element
containedExceptions[pIndex]
java.lang.ArrayIndexOutOfBoundsException
- if the index is negative or not less than the current size of
teamMembers
public void setContainedException(int pPosition, java.lang.Throwable pThrowable) throws java.lang.IndexOutOfBoundsException
containedExceptions
at the specified index.
pPosition
- index of the desired elementpThrowable
- the nested exception
java.lang.IndexOutOfBoundsException
- if the index is negative or not less than the current size of
teamMembers
public java.util.Iterator iterContainedExceptions()
containedExceptions
.
ContainedExceptions
public int getContainedExceptionsSize()
containedExceptions
.
ContainedExceptions
public java.lang.String toString()
Throwable
object was created with a non-null
detail message string, then the result is the concatenation of three strings: getMessage()
method for this object
Throwable
object was created with a null detail message string, then the name
of the actual class of this object is returned.
toString
in class java.lang.Throwable
public static java.lang.String buildString(java.lang.Throwable pThrowable, java.lang.String pOffSet)
pThrowable
- the throwable for which the string is required.pOffSet
- the prefix that is to be attached to the final string, allows for indentation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |