Error handling in Express.js

See here for the original answer.

This page describing basic error handling in Express might be helpful to you. It's hard to give any more specific information because we do not know what type of errors you anticipate getting.

If you mean specifically with createReadStream, the methods discussed here might be helpful to you:

readStream = filesys.createReadStream(
  path.join(__dirname, "static", "post_request.html")
);
readStream.on("error", function() { /*handle error*/ });
res.writeHead(200, { "Content-type": "text/html" });
readStream.pipe(res);

Tags

  1. javascript (Private)
  2. nodejs (Private)
  3. oauth2 (Private)
  4. express (Private)
  5. stack-overflow (Private)
  6. answer (Private)