next.js/test/integration/custom-error-page-exception/pages/_error.js
_error.js12 lines268 B
let renderCount = 0

export default function Error() {
  renderCount++

  // Guard to avoid endless loop crashing the browser tab.
  if (typeof window !== 'undefined' && renderCount < 3) {
    throw new Error('crash')
  }
  return `error threw ${renderCount} times`
}
Quest for Codev2.0.0
/
SIGN IN