Replies: 2 comments 6 replies
-
@timneutkens Any plans for this? 🙏 |
Beta Was this translation helpful? Give feedback.
0 replies
-
You could do something along these lines in your import Error from "next/error";
function MyApp({Component, pageProps}) {
if (pageProps.error) {
return <Error statusCode={pageProps.error.statusCode} title={pageProps.error.message} />;
}
return (
<Component {...pageProps} />
);
}
export default MyApp; |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Related to #11281
The current pattern for handling errors in
getServerSideProps()
can only scale if implemented with an HOC that intercepts the error code (you don't want to add that logic for rendering the error page to every page that usesgetServerSideProps
). It'd be nice if Next just handled it for us via something like this:Beta Was this translation helpful? Give feedback.
All reactions