-
Notifications
You must be signed in to change notification settings - Fork 1
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
Error page #48
Error page #48
Conversation
src/text.js
Outdated
@@ -4,6 +4,7 @@ module.exports = { | |||
homePage: 'Home Page', | |||
english: 'English', | |||
arabic: 'Arabic', | |||
error: 'Bad request !!', |
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.
Might be good to have other errors too (e.g. Not Found
)
Also maybe drop the exclamation marks?
You should address this issue #50 in this PR And also I would say make an 'error' layout, as well as an 'error' view, and then pass the view some details about the error - like in the handlebars workshop here: I guess the 'layout' part isn't 100% necessary in our case, but definitely should have a generic error page and pass it different variables whenever we render it. |
Also need to do it in the language check middleware as well: |
@@ -62,10 +65,13 @@ module.exports = (req, res) => { | |||
}; | |||
Request(reqOptions, (error, apiResponse, apiResponseBody) => { | |||
if (error) { | |||
res.status(400).send('server error'); | |||
res.render('error'); |
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.
Does this one need some parameters passing to it?
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.
related to #37 #50