Error which occurred while loading or decoding configuration values.
Configuration errors can be created using ConfigError.apply, or with ConfigError.sensitive if the error might contain sensitive details. When writing ConfigDecoders, ConfigError.decode can be useful for creating decoding errors.
Errors for a single configuration value, which might be retrieved from one of multiple sources, can be combined and accumulated with ConfigError#or. Errors for multiple configuration values can similarly be accumulated using ConfigError#and.
Error messages can be retrieved using ConfigError#messages. If the error relates to a value which might contain sensitive details, ConfigError#redacted can be used to redact such details. When ConfigValue#secret is used, sensitive details are redacted and the value is wrapped in Secret to prevent it from being shown.
A Throwable representation of a ConfigError can be retrieved
using ConfigError#throwable.
- Example:
scala> val error = ConfigError("error") error: ConfigError = ConfigError(error) scala> val sensitive = ConfigError.sensitive("error", "redacted") sensitive: ConfigError = Sensitive(error, redacted) scala> error.or(sensitive).messages res0: cats.data.Chain[String] = Chain(Error and error) scala> error.and(sensitive).redacted.messages res1: cats.data.Chain[String] = Chain(error, redacted)- Companion:
- object
Value members
Abstract methods
Returns the error messages of the contained errors.
Returns the error messages of the contained errors.
Returns a new ConfigError with sensitive details redacted.
Returns a new ConfigError with sensitive details redacted.
Concrete methods
Returns a new ConfigError combining errors for separate configuration values.
Returns a new ConfigError combining errors for separate configuration values.
Returns a new ConfigError combining errors for a single configuration value.
Returns a new ConfigError combining errors for a single configuration value.