You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
416 B
13 lines
416 B
3 years ago
|
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,
|
||
|
}))
|
||
|
}
|