diff --git a/lib/error.js b/lib/error.js index 7248d1dd..cef4d786 100644 --- a/lib/error.js +++ b/lib/error.js @@ -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
diff --git a/package.json b/package.json index 576a883b..c4706d23 100644 --- a/package.json +++ b/package.json @@ -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",