Home / Function/ handle500Response() — astro Function Reference

handle500Response() — astro Function Reference

Architecture documentation for the handle500Response() function in response.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  1616454b_deab_c423_181c_953c5080c0e8["handle500Response()"]
  4611d913_9978_903f_46fc_e5961ccf4da7["response.ts"]
  1616454b_deab_c423_181c_953c5080c0e8 -->|defined in| 4611d913_9978_903f_46fc_e5961ccf4da7
  b0b80fd6_882e_1ae8_0437_067b6f956964["writeHtmlResponse()"]
  1616454b_deab_c423_181c_953c5080c0e8 -->|calls| b0b80fd6_882e_1ae8_0437_067b6f956964
  style 1616454b_deab_c423_181c_953c5080c0e8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/vite-plugin-astro-server/response.ts lines 10–28

export async function handle500Response(
	loader: ModuleLoader,
	res: http.ServerResponse,
	err: ErrorWithMetadata,
) {
	res.on('close', async () =>
		setTimeout(async () => loader.webSocketSend(await getViteErrorPayload(err)), 200),
	);
	if (res.headersSent) {
		res.write(`<script type="module" src="/@vite/client"></script>`);
		res.end();
	} else {
		writeHtmlResponse(
			res,
			500,
			`<title>${err.name}</title><script type="module" src="/@vite/client"></script>`,
		);
	}
}

Domain

Subdomains

Frequently Asked Questions

What does handle500Response() do?
handle500Response() is a function in the astro codebase, defined in packages/astro/src/vite-plugin-astro-server/response.ts.
Where is handle500Response() defined?
handle500Response() is defined in packages/astro/src/vite-plugin-astro-server/response.ts at line 10.
What does handle500Response() call?
handle500Response() calls 1 function(s): writeHtmlResponse.

Analyze Your Own Codebase

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

Try Supermodel Free