fix(server): pass context into 500 handlers (#1720)

This commit is contained in:
Reed von Redwitz
2023-09-01 15:56:47 +02:00
committed by GitHub
parent dbc430efe6
commit 03df5f7306
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -904,7 +904,7 @@ export class ServerContext {
{ {
...ctx, ...ctx,
error, error,
render: errorHandlerRender(req, {}, undefined, error), render: errorHandlerRender(req, {}, ctx, error),
}, },
); );
}; };
+4
View File
@@ -267,6 +267,10 @@ Deno.test("/failure", async () => {
assertEquals(resp.status, Status.InternalServerError); assertEquals(resp.status, Status.InternalServerError);
const body = await resp.text(); const body = await resp.text();
assert(body.includes("500 internal error: it errored!")); assert(body.includes("500 internal error: it errored!"));
assertStringIncludes(
body,
`<meta name="generator" content="The freshest framework!"/>`,
);
}); });
Deno.test("/foo/:path*", async () => { Deno.test("/foo/:path*", async () => {