daton/lib/src/error/ConfigError.ts

13 lines
359 B
TypeScript
Raw Normal View History

/**
* An error to be thrown when a configuration value is invalid.
*/
export class ConfigError extends Error {
constructor(
public readonly key: string,
public readonly supplied_value: any,
message?: string
) {
super(message || `The value of the config key "${key}" is invalid. (${supplied_value} provided)`)
}
}