Project Files
src / errors / invalid-timezone-error.ts
/**
* Error thrown when a caller supplies a timezone name not recognised by the host ICU database.
*/
export class InvalidTimezoneError extends Error {
/** The rejected timezone name as supplied by the caller. */
public readonly timezone: string
/**
* Construct an InvalidTimezoneError for the supplied timezone.
*
* @param timezone - The rejected IANA timezone name.
*/
public constructor(timezone: string) {
super(`Unknown timezone: ${timezone}`)
this.name = "InvalidTimezoneError"
this.timezone = timezone
}
}