Home / File/ errors.ts — astro Source File

errors.ts — astro Source File

Architecture documentation for errors.ts, a typescript file in the astro codebase. 2 imports, 0 dependents.

File typescript CoreAstro RenderingEngine 2 imports 3 functions 7 classes

Entity Profile

Dependency Diagram

graph LR
  6040eeed_628d_7649_3de3_370870542dad["errors.ts"]
  f87041c0_adb2_b5e5_4096_6b2c67c52a62["./printer.js"]
  6040eeed_628d_7649_3de3_370870542dad --> f87041c0_adb2_b5e5_4096_6b2c67c52a62
  a2586aae_ce09_613d_4444_659268b61a89["core"]
  6040eeed_628d_7649_3de3_370870542dad --> a2586aae_ce09_613d_4444_659268b61a89
  style 6040eeed_628d_7649_3de3_370870542dad fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { $ZodError } from 'zod/v4/core';
import { codeFrame } from './printer.js';

interface ErrorProperties {
	title?: string;
	name: string;
	message?: string;
	location?: ErrorLocation;
	hint?: string;
	stack?: string;
	frame?: string;
}

export interface ErrorLocation {
	file?: string;
	line?: number;
	column?: number;
}

type ErrorTypes =
	| 'AstroError'
	| 'AstroUserError'
	| 'CompilerError'
	| 'CSSError'
	| 'MarkdownError'
	| 'InternalError'
	| 'AggregateError';

export function isAstroError(e: unknown): e is AstroError {
	return e != null && (e instanceof AstroError || AstroError.is(e));
}

export class AstroError extends Error {
	public loc: ErrorLocation | undefined;
	public title: string | undefined;
	public hint: string | undefined;
	public frame: string | undefined;

	type: ErrorTypes = 'AstroError';

	constructor(props: ErrorProperties, options?: ErrorOptions) {
		const { name, title, message, stack, location, hint, frame } = props;
		super(message, options);

		this.title = title;
		this.name = name;

		if (message) this.message = message;
		// Only set this if we actually have a stack passed, otherwise uses Error's
		this.stack = stack ? stack : this.stack;
		this.loc = location;
		this.hint = hint;
		this.frame = frame;
	}

	public setLocation(location: ErrorLocation): void {
		this.loc = location;
	}

	public setName(name: string): void {
// ... (137 more lines)

Domain

Subdomains

Dependencies

  • ./printer.js
  • core

Frequently Asked Questions

What does errors.ts do?
errors.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in errors.ts?
errors.ts defines 3 function(s): isAstroConfigZodError, isAstroError, trackAstroConfigZodError.
What does errors.ts depend on?
errors.ts imports 2 module(s): ./printer.js, core.
Where is errors.ts in the architecture?
errors.ts is located at packages/astro/src/core/errors/errors.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/core/errors).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free