Commit 45e77d53 authored by Naoyuki Kanezawa's avatar Naoyuki Kanezawa Committed by Tim Neutkens

Fix status messages on error (#1131)

* fix status messages on error

* error: use the special message for 404
parent fb8f0506
import React from 'react' import React from 'react'
import HTTPStatus from 'http-status'
import Head from './head' import Head from './head'
export default class Error extends React.Component { export default class Error extends React.Component {
...@@ -11,7 +12,7 @@ export default class Error extends React.Component { ...@@ -11,7 +12,7 @@ export default class Error extends React.Component {
const { statusCode } = this.props const { statusCode } = this.props
const title = statusCode === 404 const title = statusCode === 404
? 'This page could not be found' ? 'This page could not be found'
: (statusCode ? 'Internal Server Error' : 'An unexpected error has occurred') : HTTPStatus[statusCode] || 'An unexpected error has occurred'
return <div style={styles.error}> return <div style={styles.error}>
<Head> <Head>
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
"glamor": "2.20.23", "glamor": "2.20.23",
"glob-promise": "3.1.0", "glob-promise": "3.1.0",
"htmlescape": "1.1.1", "htmlescape": "1.1.1",
"http-status": "1.0.1",
"is-windows-bash": "1.0.3", "is-windows-bash": "1.0.3",
"json-loader": "0.5.4", "json-loader": "0.5.4",
"loader-utils": "0.2.16", "loader-utils": "0.2.16",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment