open-vault/website/pages/_error.jsx
Bryce Kalow 45dfa2dd02
web: migrate to web platform- packages (#12118)
* migrate usages of nextjs-scripts to platform packages

* Updates hashi packages
2021-07-27 18:43:40 -04:00

15 lines
373 B
JavaScript

import NotFound from './404'
import Bugsnag from '@hashicorp/platform-runtime-error-monitoring'
function Error({ statusCode }) {
return <NotFound statusCode={statusCode} />
}
Error.getInitialProps = ({ res, err }) => {
if (err) Bugsnag.notify(err)
const statusCode = res ? res.statusCode : err ? err.statusCode : 404
return { statusCode }
}
export default Error