Use newly Node.js domains to handle errors and cleanup when exiting