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