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