Open helenzhou6 opened 6 years ago
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:
handler.js
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: https://github.com/fac-13/PaGiToNi/blob/7a5fea2756152ef2845ba5370cc0cee026ce7f4f/public/index.js#L44-L46
I would somehow try and display the error (such as there has been a server error) to the user rather than console.log
console.log
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:Here
But in the front end the error message is not being used and displayed to the user: https://github.com/fac-13/PaGiToNi/blob/7a5fea2756152ef2845ba5370cc0cee026ce7f4f/public/index.js#L44-L46
I would somehow try and display the error (such as there has been a server error) to the user rather than
console.log