AWS Lambda has nice safeguards for logging but not great handling for error reporting. I typically use Sentry but in this project, we're using Rollbar
Here's a setup to remove AWS Lambda's forceful exit on uncaught error and replace it with an error reporter to Rollbar:
// Load in our dependencies
const assert = require('assert');
const Rollbar = require('rollbar');
// Initialize our Rollbar handler