public class PatriusException extends Exception
When the Patrius classes throw exceptions that are specific to the package, these exceptions are always subclasses of OrekitException. When exceptions that are already covered by the standard java API should be thrown, like ArrayIndexOutOfBoundsException or InvalidParameterException, these standard exceptions are thrown rather than the commons-math specific ones.
This class also provides utility methods to throw some standard java exceptions with localized messages.
| Constructor and Description |
|---|
PatriusException(ExceptionContextProvider provider)
Simple constructor.
|
PatriusException(Localizable specifierIn,
Object... partsIn)
Simple constructor.
|
PatriusException(Localizable message,
Throwable cause)
Simple constructor.
|
PatriusException(PatriusException exception)
Copy constructor.
|
PatriusException(Throwable cause,
Localizable specifierIn,
Object... partsIn)
Simple constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static IllegalArgumentException |
createIllegalArgumentException(Localizable specifier,
Object... parts)
Create an
IllegalArgumentException with localized message. |
static IllegalStateException |
createIllegalStateException(Localizable specifier,
Object... parts)
Create an
IllegalStateException with localized message. |
static RuntimeException |
createInternalError(Throwable cause)
Create an
RuntimeException for an internal error. |
static ParseException |
createParseException(Localizable specifier,
Object... parts)
Create an
ParseException with localized message. |
String |
getLocalizedMessage() |
String |
getMessage() |
String |
getMessage(Locale locale)
Gets the message in a specified locale.
|
Object[] |
getParts()
Get the variable parts of the error message.
|
Localizable |
getSpecifier()
Get the localizable specifier of the error message.
|
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic PatriusException(Localizable specifierIn, Object... partsIn)
specifierIn - format specifier (to be translated)partsIn - parts to insert in the format (no translation)public PatriusException(PatriusException exception)
exception - exception to copy frompublic PatriusException(Localizable message, Throwable cause)
message - descriptive messagecause - underlying causepublic PatriusException(Throwable cause, Localizable specifierIn, Object... partsIn)
cause - underlying causespecifierIn - format specifier (to be translated)partsIn - parts to insert in the format (no translation)public PatriusException(ExceptionContextProvider provider)
provider - underlying exception context providerpublic String getMessage(Locale locale)
locale - Locale in which the message should be translatedpublic String getMessage()
getMessage in class Throwablepublic String getLocalizedMessage()
getLocalizedMessage in class Throwablepublic Localizable getSpecifier()
public Object[] getParts()
public static IllegalArgumentException createIllegalArgumentException(Localizable specifier, Object... parts)
IllegalArgumentException with localized message.specifier - format specifier (to be translated)parts - parts to insert in the format (no translation)IllegalArgumentException with localized messagepublic static IllegalStateException createIllegalStateException(Localizable specifier, Object... parts)
IllegalStateException with localized message.specifier - format specifier (to be translated)parts - parts to insert in the format (no translation)IllegalStateException with localized messagepublic static ParseException createParseException(Localizable specifier, Object... parts)
ParseException with localized message.specifier - format specifier (to be translated)parts - parts to insert in the format (no translation)ParseException with localized messagepublic static RuntimeException createInternalError(Throwable cause)
RuntimeException for an internal error.cause - underlying causeRuntimeException for an internal errorCopyright © 2024 CNES. All rights reserved.