chore: add test for middleware error handling (#1453)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { Handlers, PageProps } from "$fresh/server.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
GET(req, ctx) {
|
||||
return ctx.render(ctx.state.flag);
|
||||
},
|
||||
};
|
||||
|
||||
export default function Home(props: PageProps<boolean>) {
|
||||
if (props.data) {
|
||||
throw Error("i'm erroring on purpose");
|
||||
}
|
||||
return <div>this won't get shown</div>;
|
||||
}
|
||||
Reference in New Issue
Block a user