Error page fix

main
Ashelyn Dawn 5 years ago
parent 4f16a0f8ea
commit d3f4cd44ff

@ -1,8 +1,20 @@
const errorMessages = {
404: {title: 'Page not found', message: 'Unfortunately that page could not be found. If you followed a link to get here, please let the owner of the link know that they need to update it.'},
[undefined]: {title: 'Unknown error', message: "We're not exactly sure what happened"}
}
export default function ErrorDisplay({error}){
const defaults = errorMessages[error.status]
return (
<>
<h1>{error.name}</h1>
<p>{error.message}</p>
<h2>{error.name || defaults.title}</h2>
<p>{error.message || defaults.message}</p>
{process.env.NODE_ENV === 'development' && (
<pre>
{JSON.stringify(error, null, 2)}
</pre>
)}
</>
)
}

@ -69,6 +69,7 @@ module.exports = withImages({
return config
},
env: {
STRIPE_PUBLIC_KEY: process.env.STRIPE_PUBLIC_KEY
STRIPE_PUBLIC_KEY: process.env.STRIPE_PUBLIC_KEY,
NODE_ENV: process.env.NODE_ENV || 'development'
}
})

Loading…
Cancel
Save