public class QueryTestFailedException extends Exception
Subclasses of this exception typically only need to implement whatever constructors they need.
Constructor and Description |
---|
QueryTestFailedException()
Construct a default instance of this class.
|
QueryTestFailedException(String message)
Construct an instance with the specified error message.
|
QueryTestFailedException(String code,
String message)
Construct an instance with the specified error code and message.
|
QueryTestFailedException(Throwable e)
Construct an instance with a linked exception specified.
|
QueryTestFailedException(Throwable e,
String message)
Construct an instance with the linked exception and error message specified.
|
QueryTestFailedException(Throwable e,
String code,
String message)
Construct an instance with the linked exception, error code, and error message specified.
|
Modifier and Type | Method and Description |
---|---|
Throwable |
getChild()
Get the exception which is linked to this exception.
|
static String |
getClassShortName(Class<?> cls)
Utility method to get the name of a class, without package information.
|
String |
getCode()
Get the error code.
|
String |
getFormattedMessage(Throwable throwable,
int level)
Returns the error message, formatted for output.
|
String |
getMessage() |
void |
setChild(Throwable child)
Set the exception which is linked to this exception.
|
void |
setCode(String code)
Set the error code.
|
String |
toString()
Returns a string representation of this class.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public QueryTestFailedException()
public QueryTestFailedException(String message)
message
- The error message or a resource bundle keypublic QueryTestFailedException(String code, String message)
code
- The error codemessage
- The error message or a resource bundle keypublic QueryTestFailedException(Throwable e)
TeiidRuntimeException
, then the code will be set to the exception's code.e
- An exception to chain to this exceptionpublic QueryTestFailedException(Throwable e, String message)
TeiidRuntimeException
, the code will be set to the exception's code.e
- The exception to chain to this exceptionmessage
- The error message or a resource bundle keypublic QueryTestFailedException(Throwable e, String code, String message)
e
- The exception to chain to this exceptioncode
- The error codemessage
- The error message or a resource bundle keypublic static String getClassShortName(Class<?> cls)
cls
- The class to get the name ofpublic Throwable getChild()
public String getCode()
public String getFormattedMessage(Throwable throwable, int level)
The default formatting provided by this method is to prepend the error message with the level and the name of the class, and to append the error code on the end if a non-zero code is defined.
This method provides a hook for subclasses to override the default formatting of any one exception.
except
- The exception to printlevel
- The depth of the exception in the chain of exceptionspublic String getMessage()
getMessage
in class Throwable
public void setChild(Throwable child)
For the special case of an InvocationTargetException, which is
a wrapped exception provided in the java.lang.reflect
package, the child is set to the wrapped exception, and the message,
if not yet defined, is set to the message of the wrapped exception.
child
- The linked exceptionpublic void setCode(String code)
code
- The error codeCopyright © 2019. All rights reserved.