Skip to content
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

Merged
merged 8 commits into from
Oct 1, 2017
Merged

Error page #48

merged 8 commits into from
Oct 1, 2017

Conversation

Suuuuha
Copy link
Collaborator

@Suuuuha Suuuuha commented Sep 26, 2017

related to #37 #50

@Suuuuha Suuuuha requested a review from jwld September 26, 2017 14:51
src/text.js Outdated
@@ -4,6 +4,7 @@ module.exports = {
homePage: 'Home Page',
english: 'English',
arabic: 'Arabic',
error: 'Bad request !!',
Copy link
Collaborator

@jwld jwld Sep 27, 2017

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?

@m4v15
Copy link
Collaborator

m4v15 commented Sep 28, 2017

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:
https://github.com/foundersandcoders/express-handlebars-workshop/blob/solution/src/controllers/error.js

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.

@m4v15
Copy link
Collaborator

m4v15 commented Sep 28, 2017

Also need to do it in the language check middleware as well:
https://github.com/foundersandcoders/OTP-Data-Entry/blob/error-handling/src/middleware/langError.js#L9

@Suuuuha
Copy link
Collaborator Author

Suuuuha commented Sep 28, 2017

@m4v15 @jwld

@@ -62,10 +65,13 @@ module.exports = (req, res) => {
};
Request(reqOptions, (error, apiResponse, apiResponseBody) => {
if (error) {
res.status(400).send('server error');
res.render('error');
Copy link
Collaborator

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jwld maybe @Suuuuha so she sees this? Not sure actually if that helps

@m4v15 m4v15 merged commit 1563001 into master Oct 1, 2017
@m4v15 m4v15 deleted the error-handling branch October 1, 2017 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants