Class: TomekitError

Defined in: errors/tomekit-error.ts:16

The base of every error tomekit throws.

Extends

  • Error

Example

import { build } from "vite";
import { BrokenContentError } from "tomekit";

// Vite wraps errors thrown by plugins and keeps them under `errors`.
const failure = await build().catch((cause: unknown) => cause);
const errors = failure instanceof Error && "errors" in failure ? failure.errors : [];
const broken = Array.isArray(errors) ? errors.find((error) => error instanceof BrokenContentError) : undefined;
broken?.errors[0]?.file // "content/posts/hello.md"

Properties

name

name: string;

Defined in: errors/tomekit-error.ts:17