Package io.dropwizard.configuration
Class ConfigurationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
io.dropwizard.configuration.ConfigurationException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ConfigurationParsingException,ConfigurationValidationException
Base class for problems with a Configuration object.
Refer to the implementations for different classes of problems:
Refer to the implementations for different classes of problems:
- Parsing errors:
ConfigurationParsingException - Validation errors:
ConfigurationValidationException
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConfigurationException(String path, Collection<String> errors) Creates a new ConfigurationException for the given path with the given errors.protectedConfigurationException(String path, Collection<String> errors, Throwable cause) Creates a new ConfigurationException for the given path with the given errors and cause. -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringformatMessage(String file, Collection<String> errors) Formats a message for the exception reporting the errors that occurred related to the configuration.Returns the configuration errors.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
NEWLINE
A constant representing a newline sequence.
-
-
Constructor Details
-
ConfigurationException
Creates a new ConfigurationException for the given path with the given errors.- Parameters:
path- the bad configuration patherrors- the errors in the path
-
ConfigurationException
Creates a new ConfigurationException for the given path with the given errors and cause.- Parameters:
path- the bad configuration patherrors- the errors in the pathcause- the cause of the error(s)
-
-
Method Details
-
getErrors
Returns the configuration errors.- Returns:
- a collection of strings representing the configuration errors
-
formatMessage
Formats a message for the exception reporting the errors that occurred related to the configuration.- Parameters:
file- the configuration fileerrors- the configuration errors- Returns:
- the formatted message
-