Packages

  • package root

    This is the API documentation for Ciris: lightweight, extensible, and validated configuration loading in Scala.
    The documentation is kept up-to-date with new releases, currently documenting release v0.12.1 on Scala 2.12.
    Please note that the documentation targets the JVM, and there may be differences on Scala.js and Scala Native.

    This is the API documentation for Ciris: lightweight, extensible, and validated configuration loading in Scala.
    The documentation is kept up-to-date with new releases, currently documenting release v0.12.1 on Scala 2.12.
    Please note that the documentation targets the JVM, and there may be differences on Scala.js and Scala Native.

    Ciris is divided into the following set of modules.

    • The cats module integrates with cats for type classes and type class instances.
    • The cats-effect module integrates with cats-effect for type classes for effect types.
    • The core module provides basic functionality and support for standard library types.
    • The enumeratum module integrates with enumeratum to be able to read enumerations.
    • The generic module uses shapeless to be able to read products and coproducts.
    • The refined module integrates with refined to be able to read refinement types.
    • The spire module integrates with spire to be able to read more number types.
    • The squants module integrates with squants to read values with unit of measure.

    If you're looking for usage instructions, please refer to the usage guide.

    Definition Classes
    root
  • package ciris

    The main namespace of Ciris is ciris, and the easiest way to get started is to bring it into scope with an import.
    If you are looking for a getting started guide, with examples and explanations, please refer to the usage guide.

    The main namespace of Ciris is ciris, and the easiest way to get started is to bring it into scope with an import.
    If you are looking for a getting started guide, with examples and explanations, please refer to the usage guide.

    Definition Classes
    root
  • package api
    Definition Classes
    ciris
  • package cats

    Module providing an integration with cats.

    Module providing an integration with cats.

    Definition Classes
    ciris
  • package decoders
    Definition Classes
    ciris
  • package enumeratum

    Module providing an integration with enumeratum.

    Module providing an integration with enumeratum.

    Definition Classes
    ciris
  • package generic

    Module using shapeless for generic derivation of ConfigDecoders.

    Module using shapeless for generic derivation of ConfigDecoders.

    Definition Classes
    ciris
  • package refined

    Module providing an integration with refined.

    Module providing an integration with refined.

    Definition Classes
    ciris
  • package spire

    Module providing an integration with spire.

    Module providing an integration with spire.

    Definition Classes
    ciris
  • package squants

    Module providing an integration with squants.

    Module providing an integration with squants.

    Definition Classes
    ciris
  • ConfigDecoder
  • ConfigEntry
  • ConfigError
  • ConfigErrors
  • ConfigException
  • ConfigKeyType
  • ConfigResult
  • ConfigSource
  • ConfigValue
  • Secret

object ConfigError

Source
ConfigError.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConfigError
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply(message: ⇒ String): ConfigError

    Creates a new ConfigError with the specified message.

    Creates a new ConfigError with the specified message. Note that the specified message should not contain any potentially sensitive details, like secret configuration values. If that's the case, you can instead use sensitive and provide a redacted message.

    message

    the message to use for the ConfigError

    returns

    a new ConfigError with the specified message

    Example:
    1. scala> ConfigError("error1")
      res0: ConfigError = ConfigError(error1)
    Note

    note that the message is passed by reference, meaning it will not be evaluated until the ConfigError#message method is invoked.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. def combined(first: ConfigError, second: ConfigError, rest: ConfigError*): ConfigError

    Combines two or more ConfigErrors into a single ConfigError.

    Combines two or more ConfigErrors into a single ConfigError. This is useful when there is more than one error when reading or decoding a value.

    first

    the first ConfigError to combine

    second

    the second ConfigError to combine

    rest

    any remaining ConfigErrors to combine

    returns

    a new ConfigError combining all specified errors

    Examples:
    1. you can use the ConfigError#combined method.

      scala> ConfigError.combined(ConfigError("error1"), ConfigError("error2"))
      res0: ConfigError = Combined(ConfigError(error1), ConfigError(error2))
    2. ,
    3. you can use the ConfigError#combine method.

      scala> ConfigError("error1") combine ConfigError("error2")
      res1: ConfigError = Combined(ConfigError(error1), ConfigError(error2))
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def left[A](error: ConfigError): Either[ConfigError, A]

    Wraps the specified ConfigError in an Either[ConfigError, A].

    Wraps the specified ConfigError in an Either[ConfigError, A]. Useful in cases where it is necessary to guide type inference and widen a Left into an Either[ConfigError, A].

    A

    the right side value of the Either

    error

    the error which should be wrapped

    returns

    the specified error as an Either[ConfigError, A]

  15. def missingKey[K](key: K, keyType: ConfigKeyType[K]): ConfigError

    Creates a new error representing the fact that a key is missing from the configuration source, that is, that there is no value for a specified key.

    Creates a new error representing the fact that a key is missing from the configuration source, that is, that there is no value for a specified key. Accepts a key value of type K and a matching ConfigKeyType.

    K

    the type of the key

    key

    the key which is missing from the configuration source

    keyType

    the name and type of keys the source supports

    returns

    a new error using the specified key and key type

    Example:
    1. scala> val error = ConfigError.missingKey("key", ConfigKeyType.Environment)
      error: ConfigError = MissingKey(key, Environment)
      
      scala> error.message
      res0: String = Missing environment variable [key]
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. def readException[K](key: K, keyType: ConfigKeyType[K], cause: Throwable): ConfigError

    Creates a new error representing the fact that there was an exception while reading a key from some configuration source.

    Creates a new error representing the fact that there was an exception while reading a key from some configuration source. Accepts a key of type K, a matching ConfigKeyType, and the Throwable cause.

    K

    the type of the key

    key

    the key for which there was a read exception

    keyType

    the name and type of keys the source supports

    cause

    the reason why there was an exception while reading

    returns

    a new error using the specified arguments

    Example:
    1. scala> val error = ConfigError.readException("key", ConfigKeyType.Environment, new Error("error"))
      error: ConfigError = ReadException(key, Environment, java.lang.Error: error)
      
      scala> error.message
      res0: String = Exception while reading environment variable [key]: java.lang.Error: error
  20. val redactedValue: String

    The placeholder to use in case details of error message need to be redacted with ConfigError#redactSensitive.

    The placeholder to use in case details of error message need to be redacted with ConfigError#redactSensitive. In case you need to create ConfigErrors with potentially sensitive details, you can use sensitive.

  21. def right[A](value: A): Either[ConfigError, A]

    Wraps the specified value in an Either[ConfigError, A].

    Wraps the specified value in an Either[ConfigError, A]. Useful in cases where it is necessary to guide type inference and widen a Right into an Either[ConfigError, A].

    A

    the type of the value

    value

    the value which should be wrapped

    returns

    the specified value as an Either[ConfigError, A]

  22. def sensitive(message: ⇒ String, redactedMessage: ⇒ String): ConfigError

    Creates a new ConfigError with the specified message, where the message might contain sensitive details, like secret configuration values.

    Creates a new ConfigError with the specified message, where the message might contain sensitive details, like secret configuration values. For this reason, a redacted message must be provided, where such details have been removed.

    You can use redactedValue as a replacement for redacted values.

    message

    the message to use for the ConfigError

    redactedMessage

    the message with any potentially sensitive details replaced with redactedValue

    returns

    a new ConfigError

    Example:
    1. scala> ConfigError.sensitive(
           |   message = "value [secret123] is not a valid Int",
           |   redactedMessage = s"value [] is not a valid Int"
           | )
      res0: ConfigError(value [secret123] is not a valid Int)
      
      scala> res0.redactSensitive
      res1: ConfigError(value [<redacted>] is not a valid Int)
    Note

    note that the messages are passed by reference, meaning they will not be evaluated until the ConfigError#message method is invoked.

  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  28. def wrongType[K, S, V, C](key: K, keyType: ConfigKeyType[K], sourceValue: Either[ConfigError, S], value: V, typeName: String, cause: Option[C]): ConfigError

    Creates a new error representing the fact that there was an error while trying to convert a configuration value to a type with name typeName.

    Creates a new error representing the fact that there was an error while trying to convert a configuration value to a type with name typeName. Accepts a key of type K, a matching ConfigKeyType, an unmodified source value of type S, a value of type V, and an optional cause of type C.

    K

    the type of the key

    V

    the type of the value

    C

    the type of the cause

    key

    the key for which the value was of the wrong type

    keyType

    the type of keys the configuration source reads

    value

    the value which could not be converted to the expected type

    typeName

    the name of the type for which conversion was attempted

    cause

    optionally, the reason why the conversion failed

    returns

    a new error using the specified arguments

    Example:
    1. scala> val error = ConfigError.wrongType("key", ConfigKeyType.Environment, Right("1.5"), 1.5, "Int", None)
      error: ConfigError = WrongType(key, Environment, Right(1.5), 1.5, Int)
      
      scala> error.message
      res0: String = Environment variable [key] with value [1.5] cannot be converted to type [Int]

Inherited from AnyRef

Inherited from Any

Ungrouped