Skip to content

Commit

Permalink
chore(nextjs): _error.js documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
subzero10 committed Apr 14, 2023
1 parent 3f404e5 commit c123306
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/nextjs/templates/_error.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
import { notifyFromNextErrorComponent } from '@honeybadger-io/nextjs';
import NextErrorComponent from 'next/error';

/**
* This component is called when:
* - on the server, when data fetching methods throw or reject
* - on the client, when getInitialProps throws or rejects
* - on the client, when a React lifecycle method (render, componentDidMount, etc) throws or rejects
* and was caught by the built-in Next.js error boundary
*/
const CustomErrorComponent = props => {
return <NextErrorComponent statusCode={props.statusCode} />;
};
Expand Down

0 comments on commit c123306

Please sign in to comment.