Improve error handling with Node.js