public class ChainedException extends Exception implements L10NMessage
Constructor and Description |
---|
ChainedException()
No argument constructor
|
ChainedException(String message)
Constructor
|
ChainedException(String rbName,
String errorCode,
Object[] args,
Throwable nestedException)
Constructor Constructs an instance of
ChainedException to
pass the localized error message At this level, the locale of the caller
is not known and it is not possible to throw localized error message at
this level. |
ChainedException(String message,
Throwable nestedException)
Constructor
|
ChainedException(Throwable nestedException)
Constructor
|
Modifier and Type | Method and Description |
---|---|
String |
getCompleteL10NMessage(Locale locale)
Returns localized error message.
|
String |
getErrorCode()
Use this method to chain this exception with another to get localized
error messge use getL10NMessage method
|
String |
getL10NMessage(Locale locale)
Returns localized error message.
|
String |
getMessage()
Gets messages of the exceptions including the chained exceptions
|
Object[] |
getMessageArgs()
Use this method to chain this exception with another to get localized
error messge use getL10NMessage method
|
String |
getResourceBundleName()
Returns resource bundle name associated with this error message.
|
void |
printStackTrace()
Prints the stack trace of the root exception to standard error stream.
|
void |
printStackTrace(PrintStream ps)
Prints the stack trace of the root exception to a PrintStream Also prints
the messages of all the exceptions starting from top exception to the
root exception, at the top of stack trace
|
void |
printStackTrace(PrintWriter pw)
Prints the stack trace of the root exception to a PrintWriter Also prints
the messages of all the exceptions starting from top exception to the
root exception, at the top of stack trace
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
public ChainedException()
public ChainedException(String message, Throwable nestedException)
message
- String message of this exceptionnestedException
- Throwable nested in this exceptionpublic ChainedException(Throwable nestedException)
nestedException
- Throwable nested in this exceptionpublic ChainedException(String message)
message
- String message of this exceptionpublic ChainedException(String rbName, String errorCode, Object[] args, Throwable nestedException)
ChainedException
to
pass the localized error message At this level, the locale of the caller
is not known and it is not possible to throw localized error message at
this level. Instead this constructor provides Resource Bundle name and
errorCode for correctly locating the error messsage. The default
getMessage() will always return English messages only. This is consistent
with current JRErbName
- -
ResourceBundle Name to be used for getting localized error
message.errorCode
- -
Key to resource bundle. You can use ResourceBundle rb =
ResourceBunde.getBundle (rbName,locale); String localizedStr =
rb.getString(errorCode)args
- -
arguments to message. If it is not present pass them as nullnestedException
- -
The root cause of this exceptionpublic String getL10NMessage(Locale locale)
getL10NMessage
in interface L10NMessage
locale
- Input locale.ChainedException(String, String, Object[], Throwable)
public String getCompleteL10NMessage(Locale locale)
locale
- Input locale.ChainedException(String, String, Object[], Throwable)
public String getResourceBundleName()
getResourceBundleName
in interface L10NMessage
ChainedException(String, String, Object[], Throwable)
,
- to get localized error message
public String getErrorCode()
L10NMessage
getErrorCode
in interface L10NMessage
ChainedException(String, String, Object[], Throwable)
,
to get localized error message.
public Object[] getMessageArgs()
L10NMessage
getMessageArgs
in interface L10NMessage
ChainedException(String, String, Object[], Throwable)
,
to get localized error message.
public String getMessage()
getMessage
in interface L10NMessage
getMessage
in class Throwable
public void printStackTrace()
printStackTrace
in class Throwable
public void printStackTrace(PrintWriter pw)
printStackTrace
in class Throwable
pw
- PrintWriter to which to print the stack tracepublic void printStackTrace(PrintStream ps)
printStackTrace
in class Throwable
ps
- PrintStream to which to print the stack traceCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.