Class ConfigException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.github.arthurhoch.kissconfig.exceptions.ConfigException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConfigDuplicateKeyException, ConfigInterpolationException, ConfigInvalidProfileException, ConfigLoadException, ConfigMappingException, ConfigParseException

public class ConfigException extends RuntimeException
Base runtime exception for all KissConfig failures.
See Also:
  • Constructor Details

    • ConfigException

      public ConfigException(String message)
      Creates an exception with a message.
      Parameters:
      message - error message
    • ConfigException

      public ConfigException(String message, Throwable cause)
      Creates an exception with a message and cause.
      Parameters:
      message - error message
      cause - cause
    • ConfigException

      public ConfigException(String message, Throwable cause, String key, String source, String targetType, String safeValue)
      Creates an exception with diagnostic metadata.
      Parameters:
      message - error message
      cause - cause
      key - related key
      source - source name or path
      targetType - target type
      safeValue - value safe for display
  • Method Details

    • key

      public Optional<String> key()
      Returns the related key when available.
      Returns:
      optional key
    • source

      public Optional<String> source()
      Returns the related source when available.
      Returns:
      optional source
    • targetType

      public Optional<String> targetType()
      Returns the target type when available.
      Returns:
      optional target type
    • safeValue

      public Optional<String> safeValue()
      Returns the safe display value when available.
      Returns:
      optional safe value