Home / Function/ getDocsForError() — astro Function Reference

getDocsForError() — astro Function Reference

Architecture documentation for the getDocsForError() function in utils.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  33a7bc4f_e58e_162b_778d_80c698cda4b7["getDocsForError()"]
  6382d0b9_8ae6_1f6a_25b6_41a3e8e6de51["utils.ts"]
  33a7bc4f_e58e_162b_778d_80c698cda4b7 -->|defined in| 6382d0b9_8ae6_1f6a_25b6_41a3e8e6de51
  style 33a7bc4f_e58e_162b_778d_80c698cda4b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/errors/dev/utils.ts lines 228–242

export function getDocsForError(err: ErrorWithMetadata): string | undefined {
	if (err.name !== 'UnknownError' && err.name in AstroErrorData) {
		return `https://docs.astro.build/en/reference/errors/${getKebabErrorName(err.name)}/`;
	}

	return undefined;

	/**
	 * The docs has kebab-case urls for errors, so we need to convert the error name
	 * @param errorName
	 */
	function getKebabErrorName(errorName: string): string {
		return errorName.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
	}
}

Domain

Subdomains

Frequently Asked Questions

What does getDocsForError() do?
getDocsForError() is a function in the astro codebase, defined in packages/astro/src/core/errors/dev/utils.ts.
Where is getDocsForError() defined?
getDocsForError() is defined in packages/astro/src/core/errors/dev/utils.ts at line 228.

Analyze Your Own Codebase

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

Try Supermodel Free