Skip to content

⬅️ Back to Table of Contents

📄 errors.ts

📊 Analysis Summary

Metric Count
🧱 Classes 2

📚 Table of Contents

🛠️ File Location:

📂 packages/rule-schema-to-typescript-types/src/errors.ts

Classes

NotSupportedError

Class Code
export class NotSupportedError extends Error {
  constructor(thing: string, target: unknown) {
    super(
      `Generating a type for ${thing} is not currently supported:\n${JSON.stringify(
        target,
        null,
        2,
      )}`,
    );
  }
}

UnexpectedError

Class Code
export class UnexpectedError extends Error {
  constructor(error: string, target: unknown) {
    super(`Unexpected Error: ${error}:\n${JSON.stringify(target, null, 2)}`);
  }
}