Package org.orekit.errors
Class OrekitException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.orekit.errors.OrekitException
- All Implemented Interfaces:
Serializable,LocalizedException
- Direct Known Subclasses:
FrameAncestorException,TimeStampedCacheException,UnsupportedParameterException
This class is the base class for all specific exceptions thrown by
the Orekit classes.
When the Orekit 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 Hipparchus specific ones.
This class also provides utility methods to throw some standard java exceptions with localized messages.
- Author:
- Luc Maisonobe
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOrekitException(Throwable cause, Localizable specifier, Object... parts) Simple constructor.OrekitException(Localizable specifier, Object... parts) Simple constructor.OrekitException(Localizable message, Throwable cause) Simple constructor.OrekitException(MathRuntimeException exception) Simple constructor.OrekitException(OrekitException exception) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetMessage(Locale locale) Gets the message in a specified locale.Object[]getParts()Get the variable parts of the error message.Get the localizable specifier of the error message.static OrekitExceptionunwrap(MathRuntimeException exception) Recover a OrekitException, possibly embedded in aMathRuntimeException.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
OrekitException
Simple constructor. Build an exception with a translated and formatted message- Parameters:
specifier- format specifier (to be translated)parts- parts to insert in the format (no translation)
-
OrekitException
Copy constructor.- Parameters:
exception- exception to copy from- Since:
- 5.1
-
OrekitException
Simple constructor. Build an exception from a cause and with a specified message- Parameters:
message- descriptive messagecause- underlying cause
-
OrekitException
Simple constructor. Build an exception from a cause and with a translated and formatted message- Parameters:
cause- underlying causespecifier- format specifier (to be translated)parts- parts to insert in the format (no translation)
-
OrekitException
Simple constructor. Build an exception from an Hipparchus exception- Parameters:
exception- underlying Hipparchus exception- Since:
- 6.0
-
-
Method Details
-
getMessage
Gets the message in a specified locale.- Specified by:
getMessagein interfaceLocalizedException- Parameters:
locale- Locale in which the message should be translated- Returns:
- localized message
-
getMessage
- Overrides:
getMessagein classThrowable
-
getLocalizedMessage
- Overrides:
getLocalizedMessagein classThrowable
-
getSpecifier
Get the localizable specifier of the error message.- Specified by:
getSpecifierin interfaceLocalizedException- Returns:
- localizable specifier of the error message
-
getParts
Get the variable parts of the error message.- Specified by:
getPartsin interfaceLocalizedException- Returns:
- a copy of the variable parts of the error message
-
unwrap
Recover a OrekitException, possibly embedded in aMathRuntimeException.If the
MathRuntimeExceptiondoes not embed a OrekitException, a new one will be created.- Parameters:
exception- MathRuntimeException to analyze- Returns:
- a (possibly embedded) OrekitException
-