When I\'m on a development server and there is an error, Express sends the traceback as a response.
However, this is not good for production. I don\'t want anyone se
So errors can be coming from express or ejs. In case of:
Template error : Due to jade/ejs etc. Again handle the errors instead of default behaviour which is to send them to client. Use a callback and check for errors. If there is don't display them, instead show an error page.
res.render(your_template, {}, function(err, html) {
if(err) {
res.redirect('/error');
} else {
res.send(html);
}
});