fix(server): pass context into 500 handlers (#1720)
This commit is contained in:
@@ -904,7 +904,7 @@ export class ServerContext {
|
||||
{
|
||||
...ctx,
|
||||
error,
|
||||
render: errorHandlerRender(req, {}, undefined, error),
|
||||
render: errorHandlerRender(req, {}, ctx, error),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
@@ -267,6 +267,10 @@ Deno.test("/failure", async () => {
|
||||
assertEquals(resp.status, Status.InternalServerError);
|
||||
const body = await resp.text();
|
||||
assert(body.includes("500 internal error: it errored!"));
|
||||
assertStringIncludes(
|
||||
body,
|
||||
`<meta name="generator" content="The freshest framework!"/>`,
|
||||
);
|
||||
});
|
||||
|
||||
Deno.test("/foo/:path*", async () => {
|
||||
|
||||
Reference in New Issue
Block a user