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 handling - show on page to notify user #59

Open
helenzhou6 opened this issue Mar 29, 2018 · 0 comments
Open

Error handling - show on page to notify user #59

helenzhou6 opened this issue Mar 29, 2018 · 0 comments
Assignees
Labels
done issue fixed

Comments

@helenzhou6
Copy link

helenzhou6 commented Mar 29, 2018

Great error handling and use of error-first callbacks!

It looks like in your handler.js file you are sending back an error message and appropriate status code:

        res.writeHead(500, { "Content-Type": "application/json" });
        res.end(JSON.stringify({ error : "Can't get the latest articles" }));

Here

But in the front end the error message is not being used and displayed to the user:

PaGiToNi/public/index.js

Lines 44 to 46 in 7a5fea2

if (error) {
console.log(error, "something went wrong");
return;

I would somehow try and display the error (such as there has been a server error) to the user rather than console.log

@n1c0z n1c0z self-assigned this Mar 29, 2018
@n1c0z n1c0z added the done issue fixed label Mar 29, 2018
n1c0z pushed a commit that referenced this issue Mar 29, 2018
n1c0z pushed a commit that referenced this issue Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done issue fixed
Projects
None yet
Development

No branches or pull requests

2 participants