ThemeError
import { ThemeError } from "@pitlane/theme";The error createTheme throws for every structural failure: one problem, one sentence.
| Failure | Message shape |
|---|---|
| No schema entry | "space.md" has no schema entry |
| Unknown reference | "color.bg" references unknown token "color.nope" |
| Reference type mismatch | "color.bg" references "space.md" of type "dimension" where "color" is required |
| Reference to an untyped token | "color.bg" references untyped token "animate.spin" |
| Reference cycle | Reference cycle: color.a → color.b → color.a |
| Variable collision | Tokens "a.b" and "a-b" both produce the CSS variable --a-b |
| Reserved characters | Token or group name "a.b" contains characters reserved by references (".", "{", "}") |
| Empty identifier | Token path segment "!!" produces an empty CSS identifier |
| Unknown mode token | Mode "dark" overrides unknown token "color.nope" |
Bad token values raise ValidationError from remix/data-schema
instead, because there may be several and each carries its own path.
See
Extends
Error
Constructors
Constructor
new ThemeError(message?): ThemeError;Parameters
message?
string
Returns
ThemeError
Inherited from
Error.constructorConstructor
new ThemeError(message?, options?): ThemeError;Parameters
message?
string
options?
ErrorOptions
Returns
ThemeError
Inherited from
Error.constructorProperties
cause?
optional cause?: unknown;Inherited from
Error.causemessage
message: string;Inherited from
Error.messagename
name: string = "ThemeError";Overrides
Error.namestack?
optional stack?: string;Inherited from
Error.stackMethods
isError()
static isError(error): error is Error;Indicates whether the argument provided is a built-in Error instance or not.
Parameters
error
unknown
Returns
error is Error
Inherited from
Error.isError