@jsvision/core / InvalidThemeError
Class: InvalidThemeError
Defined in: color/serialize.ts:52
Thrown when a serialized theme is structurally invalid, carries a malformed color/pattern/attribute, or names an unexpected role. Extends TuiError, so one catch (e) { if (e instanceof TuiError) } handles it with every other SDK error. parseTheme never returns a partially-built theme — it throws this.
Example
ts
import { parseTheme, InvalidThemeError } from '@jsvision/core';
try {
parseTheme('{"version":1,"roles":{}}');
} catch (e) {
if (e instanceof InvalidThemeError) {
console.error('rejected theme:', e.message);
}
}Extends
Constructors
Constructor
new InvalidThemeError(
message):InvalidThemeError
Defined in: safety/errors.ts:35
Parameters
message
string
Human-readable description (never carries raw input/secrets).
Returns
InvalidThemeError