public class DBException
extends java.lang.Exception
DBExceptions can be chained so that operations such as validation, or the creation of multiple objects can result in numberous errors reported.
| Modifier | Constructor and Description |
|---|---|
protected |
DBException()
Allows subclasses to deal with objects/messages as appropriate.
|
|
DBException(DBObject obj,
java.lang.String msg)
Constructs a new DBException on the specified object with the
specified message.
|
|
DBException(DBObject obj,
java.lang.String msg,
java.lang.Throwable cause)
Constructs a new DBException on the specified object with the
specified message and wrapping the specified throwable
|
|
DBException(DBObject obj,
java.lang.Throwable cause)
Constructs a new DBException on the specified object wrapping the specified
throwable
|
|
DBException(java.lang.Throwable cause)
Constructs a new DBException wrapping a throwable, without an object.
|
| Modifier and Type | Method and Description |
|---|---|
static <T extends DBException> |
append(T dbe1,
T dbe2)
Appends one exception to the other.
|
java.lang.String |
getAllMessages()
Gets all the messages that are associated with this exception, i.e.
|
java.lang.String |
getMessage()
Gets the message for this exception.
|
DBException |
getNextException()
Retrieves the exception chained to this
DBException object. |
DBObject |
getObject()
The object on which this exception occurred.
|
DBObject[] |
getRelatedObjects()
Gets any other objects that are related to this DBException.
|
void |
setNextException(DBException ex)
Adds an
DBException object to the end of the chain. |
void |
setRelatedObjects(DBObject... objs)
Sets the objects that are related to this exception - i.e.
|
public DBException(DBObject obj, java.lang.String msg)
obj - the object on which the exception occurred.msg - the message describing the exception.public DBException(DBObject obj, java.lang.String msg, java.lang.Throwable cause)
obj - the object on which the exception occurred.msg - the message describing the exception.cause - the root cause of the exceptionpublic DBException(DBObject obj, java.lang.Throwable cause)
obj - the object on which the exception occurred.cause - the root cause of the exceptionpublic DBException(java.lang.Throwable cause)
cause - the Throwable that represents the underlying problem.protected DBException()
public DBObject getObject()
public DBObject[] getRelatedObjects()
public void setRelatedObjects(DBObject... objs)
objs - the related objectspublic DBException getNextException()
DBException object.DBException object in the chain;
null if there are nonesetNextException(oracle.javatools.db.DBException)public void setNextException(DBException ex)
DBException object to the end of the chain.ex - the new exception that will be added to the end of
the DBException chaingetNextException()public java.lang.String getMessage()
getAllMessages()getMessage in class java.lang.ThrowablegetAllMessages()public java.lang.String getAllMessages()
setNextException(oracle.javatools.db.DBException)public static <T extends DBException> T append(T dbe1, T dbe2)
dbe1 - the first exceptiondbe2 - the second exception which will be appended to the first
exception if the first exception isn't nullsetNextException(DBException)