ConfigError

ciris.ConfigError
See theConfigError companion object
sealed abstract class ConfigError

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.

Attributes

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
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def messages: Chain[String]

Returns the error messages of the contained errors.

Returns the error messages of the contained errors.

Attributes

Returns a new ConfigError with sensitive details redacted.

Returns a new ConfigError with sensitive details redacted.

Attributes

Concrete methods

final def and(that: ConfigError): ConfigError

Returns a new ConfigError combining errors for separate configuration values.

Returns a new ConfigError combining errors for separate configuration values.

Attributes

final def or(that: ConfigError): ConfigError

Returns a new ConfigError combining errors for a single configuration value.

Returns a new ConfigError combining errors for a single configuration value.

Attributes

final def throwable: Throwable

Returns a new Throwable including the contained error messages.

Returns a new Throwable including the contained error messages.

Attributes