All checks were successful
/ Build and Release Library (push) Successful in 2m11s
Reviewed-on: #2
36 lines
1.1 KiB
Scala
36 lines
1.1 KiB
Scala
package gs.config.v0
|
|
|
|
/** Error hierarchy for the `gs-config` library. Indicates that something went
|
|
* wrong while attempting to load configuration values.
|
|
*/
|
|
sealed trait ConfigError
|
|
|
|
object ConfigError:
|
|
given CanEqual[ConfigError, ConfigError] = CanEqual.derived
|
|
|
|
/** Attempted to retreive the value for some [[ConfigKey]], but no value could
|
|
* be found.
|
|
*
|
|
* @param configName
|
|
* The name of the configuration value which was not found.
|
|
*/
|
|
case class MissingValue(configName: ConfigName) extends ConfigError
|
|
|
|
/** Found a value for some [[ConfigKey]], but that value could not be parsed
|
|
* as the appropriate type.
|
|
*
|
|
* @param configName
|
|
* The name of the configuration value which could not be parsed.
|
|
* @param candidateValue
|
|
* The raw value that could not be parsed.
|
|
* @param source
|
|
* The name of the [[gs.config.v0.source.ConfigSource]] which provided the
|
|
* candidate value.
|
|
*/
|
|
case class CannotParseValue(
|
|
configName: ConfigName,
|
|
candidateValue: String,
|
|
source: String
|
|
) extends ConfigError
|
|
|
|
end ConfigError
|