gs-config/src/main/scala/gs/config/v0/ConfigError.scala
Pat Garrity e44334b364
All checks were successful
/ Build and Release Library (push) Successful in 2m11s
(minor) Version, Doc, and Minor updates. (#2)
Reviewed-on: #2
2025-03-23 15:34:25 +00:00

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