mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Fix status messages on error (#1131)
* fix status messages on error * error: use the special message for 404
This commit is contained in:
parent
fb8f050667
commit
45e77d535f
|
@ -1,4 +1,5 @@
|
|||
import React from 'react'
|
||||
import HTTPStatus from 'http-status'
|
||||
import Head from './head'
|
||||
|
||||
export default class Error extends React.Component {
|
||||
|
@ -11,7 +12,7 @@ export default class Error extends React.Component {
|
|||
const { statusCode } = this.props
|
||||
const title = statusCode === 404
|
||||
? '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}>
|
||||
<Head>
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
"glamor": "2.20.23",
|
||||
"glob-promise": "3.1.0",
|
||||
"htmlescape": "1.1.1",
|
||||
"http-status": "1.0.1",
|
||||
"is-windows-bash": "1.0.3",
|
||||
"json-loader": "0.5.4",
|
||||
"loader-utils": "0.2.16",
|
||||
|
|
Loading…
Reference in a new issue