import {FastifyReply} from "fastify"; import {renderFile} from "pug"; /** Renders the error page into the given reply. */ export function renderError({baseUrl, res, error, context}: {baseUrl: string, res: FastifyReply, error: unknown, context: string}): void { res.code(500) res.type("text/html") res.send(renderFile("static/pages/error.pug", { baseUrl, error, context, })) }