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:
See Also:
  • Field Details

    • NEWLINE

      protected static final String NEWLINE
      A constant representing a newline sequence.
  • Constructor Details

    • 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 path
      errors - 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 path
      errors - the errors in the path
      cause - the cause of the error(s)
  • Method Details

    • 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 file
      errors - the configuration errors
      Returns:
      the formatted message