A Babel plugin that automatically adds catch clauses to uncaught Promises and attaches a logging call (e.g., Sentry.captureException) to all catch blocks and .catch() handlers. Version 0.1.13 is the latest stable release. It works by injecting a configurable import for your logging service and wrapping catch clauses with a logger invocation. Differentiators: zero manual instrumentation, adds logging to existing codebases without refactoring, supports both try-catch blocks and promise chains, and allows namespace or default imports for the logging library.
npm install babel-plugin-catch-loggerVerified import paths — ran on the pinned version, not inferred.
Shows basic Babel configuration and how the plugin transforms uncaught Promises.
Review generated code and manually handle uncaught Promises in a centralized way, or disable catchPromise for specific files using a babel environment.
Set namespaced: true when using libraries like @sentry/node that export named exports only; otherwise use a library with a default export.
Ensure the run order of plugins is correct and test for conflicts, or use a single plugin for error handling.
Run `npm install @sentry/node` (or the appropriate logging library).
Check the library's exports or set namespaced: false if the library has a default export with that method.
Ensure that the appropriate Babel presets (e.g., @babel/preset-env, @babel/preset-typescript) are loaded before this plugin.
No dependency data recorded yet.