From 572ad9a25e7203e236d3d1bd1d35d1dcfb92d3e1 Mon Sep 17 00:00:00 2001 From: Mason McElvain <52104630+masonmcelvain@users.noreply.github.com> Date: Fri, 31 Mar 2023 09:41:17 -0700 Subject: [PATCH] debug: try `wrapGetServerSidePropsWithSentry` --- frontend/pages/myPage.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 frontend/pages/myPage.tsx diff --git a/frontend/pages/myPage.tsx b/frontend/pages/myPage.tsx new file mode 100644 index 00000000..020563db --- /dev/null +++ b/frontend/pages/myPage.tsx @@ -0,0 +1,18 @@ +import { wrapGetServerSidePropsWithSentry } from '@sentry/nextjs'; +import { GetServerSideProps } from 'next'; + +const MyComponent = () => { + return

Hello World!

; +}; + +export const getServerSideProps: GetServerSideProps = + wrapGetServerSidePropsWithSentry(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: {} }; + }, '/myPage'); + +export default MyComponent;