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
public abstract class ConfigurationException extends Exception
Base class for problems with a Configuration object.
Refer to the implementations for different classes of problems:- Parsing errors:
ConfigurationParsingException
- Validation errors:
ConfigurationValidationException
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConfigurationException(String path, Collection<String> errors)
Creates a new ConfigurationException for the given path with the given errors.protected
ConfigurationException(String path, Collection<String> errors, Throwable cause)
Creates a new ConfigurationException for the given path with the given errors and cause.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static String
formatMessage(String file, Collection<String> errors)
Formats a message for the exception reporting the errors that occurred related to the configuration.Collection<String>
getErrors()
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 Detail
-
NEWLINE
protected static final String NEWLINE
A constant representing a newline sequence.
-
-
Constructor Detail
-
ConfigurationException
protected ConfigurationException(String path, Collection<String> errors)
Creates a new ConfigurationException for the given path with the given errors.- Parameters:
path
- the bad configuration patherrors
- the errors in the path
-
ConfigurationException
protected ConfigurationException(String path, Collection<String> errors, Throwable cause)
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 Detail
-
getErrors
public Collection<String> getErrors()
Returns the configuration errors.- Returns:
- a collection of strings representing the configuration errors
-
formatMessage
protected static String formatMessage(String file, Collection<String> errors)
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
-
-