Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
debug: add a data fetcher that throws async
Browse files Browse the repository at this point in the history
  • Loading branch information
masonmcelvain committed Mar 31, 2023
1 parent e59c036 commit d5ee360
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions frontend/pages/myPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { GetServerSideProps } from 'next';

const MyComponent = () => {
return <h1>Hello World!</h1>;
};

export const getServerSideProps: GetServerSideProps = async (context) => {
if (context.query.myParam === 'two') {
// only throw conditionally so that this page actually builds
Promise.reject(new Error("We don't like page two"));
}

return { props: {} };
};

export default MyComponent;

0 comments on commit d5ee360

Please sign in to comment.