You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
413 B
JavaScript

import React from 'react'
import ErrorDisplay from '~/components/errorDisplay'
const ErrorPage = ({error}) => (
<ErrorDisplay error={error} />
)
ErrorPage.getInitialProps = ({ res, err }) => {
let error = err || {};
if(!error)
error = new Error('Server Error')
error.status = (err && err.status) || (res ? res.statusCode : (error.statusCode || 404))
return { error }
}
export default ErrorPage