mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-22 05:46:26 -08:00
g
Co-authored-by: Jack W. <Jack5079@users.noreply.github.com>
This commit is contained in:
parent
a761e3f470
commit
4882a8b352
File diff suppressed because one or more lines are too long
|
@ -15,13 +15,12 @@ export default async function ServeError(
|
||||||
reason: string
|
reason: string
|
||||||
) {
|
) {
|
||||||
// fetch error page if not cached
|
// fetch error page if not cached
|
||||||
if (!errorPage) {
|
errorPage ??= (
|
||||||
errorPage = (
|
|
||||||
(await readFile(`${process.cwd()}/dist/error.html`).catch((err) =>
|
(await readFile(`${process.cwd()}/dist/error.html`).catch((err) =>
|
||||||
console.error(err)
|
console.error(err)
|
||||||
)) || "<pre>$code $text</pre>"
|
)) ?? "<pre>$code $text</pre>"
|
||||||
).toString()
|
).toString()
|
||||||
}
|
|
||||||
|
|
||||||
// serve error
|
// serve error
|
||||||
return ctx.html(
|
return ctx.html(
|
||||||
|
|
Loading…
Reference in a new issue