Home / Function/ handleCompileResultErrors() — astro Function Reference

handleCompileResultErrors() — astro Function Reference

Architecture documentation for the handleCompileResultErrors() function in compile.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  4340809b_c461_1622_c24e_777b6a21aa42["handleCompileResultErrors()"]
  d1d31d2a_5ee0_0540_2ca3_25d0e761efc6["compile.ts"]
  4340809b_c461_1622_c24e_777b6a21aa42 -->|defined in| d1d31d2a_5ee0_0540_2ca3_25d0e761efc6
  4f0814b1_1631_6082_74c4_664cd0f6b457["compile()"]
  4f0814b1_1631_6082_74c4_664cd0f6b457 -->|calls| 4340809b_c461_1622_c24e_777b6a21aa42
  style 4340809b_c461_1622_c24e_777b6a21aa42 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/compile/compile.ts lines 94–125

function handleCompileResultErrors(result: TransformResult, cssTransformErrors: AstroError[]) {
	// TODO: Export the DiagnosticSeverity enum from @astrojs/compiler?
	// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
	const compilerError = result.diagnostics.find((diag) => diag.severity === 1);

	if (compilerError) {
		throw new CompilerError({
			name: 'CompilerError',
			message: compilerError.text,
			location: {
				line: compilerError.location.line,
				column: compilerError.location.column,
				file: compilerError.location.file,
			},
			hint: compilerError.hint,
		});
	}

	switch (cssTransformErrors.length) {
		case 0:
			break;
		case 1: {
			throw cssTransformErrors[0];
		}
		default: {
			throw new AggregateError({
				...cssTransformErrors[0],
				errors: cssTransformErrors,
			});
		}
	}
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does handleCompileResultErrors() do?
handleCompileResultErrors() is a function in the astro codebase, defined in packages/astro/src/core/compile/compile.ts.
Where is handleCompileResultErrors() defined?
handleCompileResultErrors() is defined in packages/astro/src/core/compile/compile.ts at line 94.
What calls handleCompileResultErrors()?
handleCompileResultErrors() is called by 1 function(s): compile.

Analyze Your Own Codebase

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

Try Supermodel Free