-
Notifications
You must be signed in to change notification settings - Fork 26.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing of title to default error page #7381
Conversation
Stats from current PRClick to expand stats
Click to expand serverless stats
|
@icco Use case for this ? you can create your own |
Sure @lfades, right now, if you pass a statusCode to next/error that isn't defined in the hash (for example, a 403), you get the error message "An unexpected error has occurred." As this isn't true, I figured updating your default error page to allow for correct messaging would be easier for lots of folks instead of recreating the page with a larger hash. |
Stats from current PRClick to expand stats
Click to expand serverless stats
|
} | ||
|
||
render () { | ||
const { statusCode } = this.props | ||
const title = statusCodes[statusCode] || 'An unexpected error has occurred' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you do const title = this.props.title || statusCodes[statusCode] || 'An unexpected error has occurred'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
Stats from current PRClick to expand stats
Click to expand serverless stats
|
Stats from current PRClick to expand stats
Click to expand serverless stats
|
* Allow passing of title to default error page * Update README to include Error#title information * Change title init location * Update _error.js
No description provided.