Class ConfigException
java.lang.Object
java.lang.Throwable
java.lang.Exception
jdk.jpackage.internal.model.ConfigException
- All Implemented Interfaces:
Serializable
Signals that error has occurred at configuration phase.
It contains an error message and an optional advice message on how to correct the error.
The preferred way to construct instances of this class is to use
build(StringBundle), or build(StringBundle, Throwable),
or build(StringBundle, String, Object...) methods.
StringBundle i18n = getStringBundle(); // Some way to obtain a string bundle with localized messages
throw ConfigException.build(i18n)
.message("error.no.name")
.advice("error.no.name.advice")
.create();
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConfigException(String msg, String advice) ConfigException(String msg, String advice, Throwable cause) ConfigException(Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigException.Builderbuild(StringBundle i18n) static ConfigException.Builderbuild(StringBundle i18n, String msgId, Object... args) static ConfigException.Builderbuild(StringBundle i18n, Throwable t) static RuntimeExceptionThrows the cause of the givenRuntimeExceptionexception asConfigExceptionif the cause is of this type or re-throws the givenRuntimeExceptionexception as-is otherwise.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ConfigException
-
ConfigException
-
ConfigException
-
-
Method Details
-
getAdvice
-
build
-
build
-
build
-
rethrowConfigException
Throws the cause of the givenRuntimeExceptionexception asConfigExceptionif the cause is of this type or re-throws the givenRuntimeExceptionexception as-is otherwise.Never return a value. It always throws some exception object.
- Parameters:
ex- exception to re-throw- Returns:
- doesn't return value
- Throws:
ConfigException
-