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:
|
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
Great error handling and use of error-first callbacks!
It looks like in your
handler.jsfile 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:
PaGiToNi/public/index.js
Lines 44 to 46 in 7a5fea2
I would somehow try and display the error (such as there has been a server error) to the user rather than
console.log