isostate Get started →

Errors

Public APIs throw structured error classes exported from @sebastianwessel/isostate.

ClassWhereExamples
ParseErrorparseScene()malformed YAML, unknown authored fields
ValidationErrorClassvalidateScene(), compileScene()missing assets, invalid deltas
RenderErrormountScene(), buildSceneDOM()bad bundle, missing assets, unsafe SVG
AnimationErrorAnimationEngineinvalid progress or uninitialized engine
ControllerErrorAnimationControllermissing scenes, invalid navigation

Every structured error has a code and message; many include contextual fields such as elementId, sceneId, assetName, or layerName.

try {
	mountScene(target, sceneBundle);
} catch (error) {
	if (error instanceof RenderError) {
		console.error(error.code, error.message);
	}
}

Common fixes:

CodeFix
BUNDLE_FORMAT_MISSINGLoad a compiled .isostate.js or .isostate.json bundle.
BUNDLE_DIGEST_MISSINGRecompile the YAML source with the current compiler.
BUNDLE_DIGEST_MISMATCHRecompile the YAML source and use the generated bundle without manual edits.
ASSET_NOT_DECLAREDAdd the asset id to header.assets.
ASSET_URL_REQUIREDAdd header.assetBaseUrl or an asset path so the compiler can emit a URL.
ASSET_NOT_FOUNDRecompile the bundle so every external asset has a URL entry.
INVALID_ASSET_URLUse a non-empty relative or HTTP(S) asset URL, not javascript:.
TEXT_CONTENT_REQUIREDAdd a non-empty text.value to an asset: text element.
TEXT_CONTENT_FOR_NON_TEXT_ASSETRemove text from non-text assets.
INVALID_TEXT_CONTENTKeep text non-empty, ≤1000 characters, and ≤20 lines.
INVALID_TEXT_STYLEUse supported text style values and safe fill colors.
PRIMITIVE_CONTENT_REQUIREDAdd the matching primitive payload to built-in primitive assets.
PRIMITIVE_CONTENT_MISMATCHKeep exactly one primitive payload and match it to the asset id.
INVALID_PRIMITIVE_POINTSKeep primitive points normalized from 0 to 1.
INVALID_PRIMITIVE_STYLEUse supported primitive style values and safe color tokens.
GENERATED_CONTENT_FOR_EXTERNAL_ASSETRemove primitive payloads from external SVG assets.
INVALID_CONNECTOR_ROUTEProvide at least two finite non-negative connector route points and keep manual segments on one grid axis.
INVALID_CONNECTOR_STYLEUse supported connector style values for pattern, variant, stroke, dash, road, and opacity fields.
INVALID_CONNECTOR_ENDPOINTUse none, arrow, dot, circle, diamond, or bar.
INVALID_CONNECTOR_DIRECTIONUse route or reverse.
INVALID_CONNECTOR_ROUTINGFix endpoint routing fields or use a manual route.
CONNECTOR_ENDPOINT_NOT_FOUNDAdd the endpoint element before the connector or fix the id.
CONNECTOR_ROUTE_BLOCKEDMove objects, reduce clearance, use avoid: none, or author a manual route.
CONNECTOR_NOT_PRESENTAdd the connector before updating or removing it.
CONNECTOR_ALREADY_PRESENTUpdate the connector instead of adding it again.
INVALID_CAMERA_TARGETUse exactly one camera target: an existing element, a valid grid area, or reset: true.
CAMERA_TARGET_NOT_FOUNDFix the element id or move the camera focus to a scene where the element exists.
CAMERA_TARGET_NOT_VISIBLEFocus an element visible in the active frame or use zoomToArea().
INVALID_CAMERA_OPTIONSUse supported easing, finite non-negative padding for element/area targets, finite positive area size, and a bounded duration. Omit padding for reset.
CAMERA_NOT_INITIALIZEDInitialize a controller with a scene SVG before calling camera methods.
TEXT_CONTENT_MISSINGRecompile the bundle from validated YAML.