import React from 'react' import getConfig from 'next/config' const {publicRuntimeConfig} = getConfig() const ErrorPage = ({error}) => { const env = publicRuntimeConfig.SOS_ENV if (!error) return ( <>
We couldn't find the item you're looking for. Sorry!
> ) return ( <>{error.message}
> ) } ErrorPage.getInitialProps = ({ctx: {err, req, res}}) => { if(!err) return {error: null} if(res) err.status = res.statusCode return { error: err } } export default ErrorPage