{"_id":"@dhrupad-sah/exception-catcher","_rev":"5-6dcd177eae5077f5ce837b9ecbf1c390","name":"@dhrupad-sah/exception-catcher","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@dhrupad-sah/exception-catcher","version":"1.0.0","keywords":["exception","error-handling","monitoring","observability","loki","logging","automation","claude","ai-fixing"],"author":{"name":"Mira Sentinel Team"},"license":"MIT","_id":"@dhrupad-sah/exception-catcher@1.0.0","maintainers":[{"name":"dhrupad-sah","email":"thedhrupad@gmail.com"}],"homepage":"https://github.com/your-org/mira-sentinel-exception-catcher#readme","bugs":{"url":"https://github.com/your-org/mira-sentinel-exception-catcher/issues"},"dist":{"shasum":"258590ad17c3f7dc8537955ce69626286b9e80eb","tarball":"https://registry.npmjs.org/@dhrupad-sah/exception-catcher/-/exception-catcher-1.0.0.tgz","fileCount":14,"integrity":"sha512-l25MGYOj7DTYA6F77B620i1Fzc60RWGzigWw3oUv6kLAUPO70GtIsUmP6eF6Gjc7qInrr0eJSDnHjf/lrKRi3g==","signatures":[{"sig":"MEUCIFq6i2IyLUaLAlmE4T4J2C2mb85hg43+dvFsghGo9SP4AiEA5lceexYDRqxS9hWsJLpmjnNHdinfKro8X6TItoFknAs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40966},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"e1f8a5eb530a6f6ace4a29916c5f6fc3f871546c","scripts":{"dev":"tsc --watch","test":"node --test dist/test/*.js","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"dhrupad-sah","email":"thedhrupad@gmail.com"},"repository":{"url":"git+https://github.com/your-org/mira-sentinel-exception-catcher.git","type":"git"},"_npmVersion":"10.8.2","description":"Automatically catch and report exceptions to Mira Sentinel with rich context and Loki log integration","directories":{},"_nodeVersion":"20.17.0","dependencies":{"axios":"^1.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/exception-catcher_1.0.0_1753259732756_0.5085408227940782","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@dhrupad-sah/exception-catcher","version":"1.0.1","keywords":["exception","error-handling","monitoring","observability","loki","logging","automation","claude","ai-fixing"],"author":{"name":"Mira Sentinel Team"},"license":"MIT","_id":"@dhrupad-sah/exception-catcher@1.0.1","maintainers":[{"name":"dhrupad-sah","email":"thedhrupad@gmail.com"}],"homepage":"https://github.com/your-org/mira-sentinel-exception-catcher#readme","bugs":{"url":"https://github.com/your-org/mira-sentinel-exception-catcher/issues"},"dist":{"shasum":"dbc2dcc14da8c64bf7e2d2ecd5a39a4adfb0c149","tarball":"https://registry.npmjs.org/@dhrupad-sah/exception-catcher/-/exception-catcher-1.0.1.tgz","fileCount":14,"integrity":"sha512-YXhymrkd6bik3bTVek83r9uTAaXN88SKv6mvJYb81uEmvQpmQOKoNs+Az5X5zAxNju726dwuCMrkKvsETQnNxQ==","signatures":[{"sig":"MEUCIFZx/R343KlghL/54fJWwL83ZrPLc7WXZ/kJKUbHLtvGAiEA8yowV6pYIgFUWcDvJtPRcwy4a74X61hY3rPpqK16l/c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40952},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"b3bd5018007a259cea6afc47516de3e1e6513925","scripts":{"dev":"tsc --watch","test":"node --test dist/test/*.js","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"dhrupad-sah","email":"thedhrupad@gmail.com"},"repository":{"url":"git+https://github.com/your-org/mira-sentinel-exception-catcher.git","type":"git"},"_npmVersion":"10.8.2","description":"Automatically catch and report exceptions to Mira Sentinel with rich context and Loki log integration","directories":{},"_nodeVersion":"20.17.0","dependencies":{"axios":"^1.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/exception-catcher_1.0.1_1753260032281_0.5100078845547149","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@dhrupad-sah/exception-catcher","version":"1.0.2","keywords":["exception","error-handling","monitoring","observability","loki","logging","automation","claude","ai-fixing"],"author":{"name":"Mira Sentinel Team"},"license":"MIT","_id":"@dhrupad-sah/exception-catcher@1.0.2","maintainers":[{"name":"dhrupad-sah","email":"thedhrupad@gmail.com"}],"homepage":"https://github.com/your-org/mira-sentinel-exception-catcher#readme","bugs":{"url":"https://github.com/your-org/mira-sentinel-exception-catcher/issues"},"dist":{"shasum":"370b671cf8d5210e39d58fe2ffe8c4ac9aff3582","tarball":"https://registry.npmjs.org/@dhrupad-sah/exception-catcher/-/exception-catcher-1.0.2.tgz","fileCount":14,"integrity":"sha512-BLr2Zu8feDNSXrCceZT+RGCgVStz4MapEipRi9TcZfGoaooiFH7kCIIVJkiK/vz4ZzcF4IhT+zsaKGfM+u1RPQ==","signatures":[{"sig":"MEYCIQC8daBcpVkOc0sCcekWMSkoWhO5DAQJrmzkGLlUFW+FvwIhANaDTUDdpHwaqOSffypTGnpcaVZf/xo33ot3MZMFICPu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40948},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"0a096220615991af82b6dc8bda96517c4f24fff9","scripts":{"dev":"tsc --watch","test":"node --test dist/test/*.js","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"dhrupad-sah","email":"thedhrupad@gmail.com"},"repository":{"url":"git+https://github.com/your-org/mira-sentinel-exception-catcher.git","type":"git"},"_npmVersion":"10.8.2","description":"Automatically catch and report exceptions to Mira Sentinel with rich context and Loki log integration","directories":{},"_nodeVersion":"20.17.0","dependencies":{"axios":"^1.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/exception-catcher_1.0.2_1753260163750_0.27957616173307676","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@dhrupad-sah/exception-catcher","version":"1.1.0","keywords":["exception","error-handling","monitoring","observability","loki","logging","automation","claude","ai-fixing"],"author":{"name":"Mira Sentinel Team"},"license":"MIT","_id":"@dhrupad-sah/exception-catcher@1.1.0","maintainers":[{"name":"dhrupad-sah","email":"thedhrupad@gmail.com"}],"homepage":"https://github.com/your-org/mira-sentinel-exception-catcher#readme","bugs":{"url":"https://github.com/your-org/mira-sentinel-exception-catcher/issues"},"dist":{"shasum":"7e095588adb6176e8d08883207532a8a88443eaa","tarball":"https://registry.npmjs.org/@dhrupad-sah/exception-catcher/-/exception-catcher-1.1.0.tgz","fileCount":18,"integrity":"sha512-ZbbBdvTwEkmG5lbZHIezu0V06dGSUdEp2i97n+Kw54ptx07xxXHDowet602OiMZZLOEwA9K4f6nAL8dj3Zv6Xw==","signatures":[{"sig":"MEQCIDklp0ktVawpys70FuaztPUfXr9/m6TFm4xRO6JAA9sQAiAQ8SGUYXdktToDSqZTFtXfg9RdwvEk8JZWhb5aXDa2Sg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51195},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"b389716bf697b6d8b712042eea6383963d0415e7","scripts":{"dev":"tsc --watch","test":"node --test dist/test/*.js","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"dhrupad-sah","email":"thedhrupad@gmail.com"},"repository":{"url":"git+https://github.com/your-org/mira-sentinel-exception-catcher.git","type":"git"},"_npmVersion":"10.8.2","description":"Automatically catch and report exceptions to Mira Sentinel with rich context and Loki log integration","directories":{},"_nodeVersion":"20.17.0","dependencies":{"axios":"^1.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"fastify":"^5.4.0","typescript":"^5.0.0","@types/node":"^20.19.9"},"peerDependencies":{"fastify":"^4.0.0"},"peerDependenciesMeta":{"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/exception-catcher_1.1.0_1753273564070_0.995315999112522","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@dhrupad-sah/exception-catcher","version":"1.1.1","description":"Automatically catch and report exceptions to Mira Sentinel with rich context and Loki log integration","main":"dist/index.js","types":"dist/index.d.ts","type":"module","scripts":{"build":"tsc","dev":"tsc --watch","test":"node --test dist/test/*.js","prepublishOnly":"npm run build"},"keywords":["exception","error-handling","monitoring","observability","loki","logging","automation","claude","ai-fixing"],"author":{"name":"Mira Sentinel Team"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/your-org/mira-sentinel-exception-catcher.git"},"bugs":{"url":"https://github.com/your-org/mira-sentinel-exception-catcher/issues"},"homepage":"https://github.com/your-org/mira-sentinel-exception-catcher#readme","dependencies":{"axios":"^1.6.0"},"devDependencies":{"@types/node":"^20.19.9","fastify":"^5.4.0","typescript":"^5.0.0"},"peerDependencies":{"fastify":"^4.0.0"},"peerDependenciesMeta":{"fastify":{"optional":true}},"engines":{"node":">=18.0.0"},"publishConfig":{"access":"public"},"_id":"@dhrupad-sah/exception-catcher@1.1.1","gitHead":"7abc7a670585046f52edfe0954b761d8458a3166","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-2u1DJ0RvR28Yf0C8mX3j9Mjqxlu1Acg6m08Z5OPloY4mufJ27FCy89ZCGnft2gAsjbnvC09M28CDsPYuMF16vg==","shasum":"3a75ff883f16e1df1da124a684266ced1ca60bbb","tarball":"https://registry.npmjs.org/@dhrupad-sah/exception-catcher/-/exception-catcher-1.1.1.tgz","fileCount":18,"unpackedSize":52156,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCKMeNAuRDe3sHiJwjODBMBlOsK2IlUa7jasB15vDG4SgIgPt67yeS2VaXPF5SKsQD+lH5kkKgi/cqDZ8YBSH2IVGA="}]},"_npmUser":{"name":"dhrupad-sah","email":"thedhrupad@gmail.com"},"directories":{},"maintainers":[{"name":"dhrupad-sah","email":"thedhrupad@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/exception-catcher_1.1.1_1753278047388_0.7757553118668978"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-23T08:35:32.681Z","modified":"2025-07-23T13:40:47.778Z","1.0.0":"2025-07-23T08:35:32.970Z","1.0.1":"2025-07-23T08:40:32.498Z","1.0.2":"2025-07-23T08:42:43.935Z","1.1.0":"2025-07-23T12:26:04.258Z","1.1.1":"2025-07-23T13:40:47.590Z"},"bugs":{"url":"https://github.com/your-org/mira-sentinel-exception-catcher/issues"},"author":{"name":"Mira Sentinel Team"},"license":"MIT","homepage":"https://github.com/your-org/mira-sentinel-exception-catcher#readme","keywords":["exception","error-handling","monitoring","observability","loki","logging","automation","claude","ai-fixing"],"repository":{"type":"git","url":"git+https://github.com/your-org/mira-sentinel-exception-catcher.git"},"description":"Automatically catch and report exceptions to Mira Sentinel with rich context and Loki log integration","maintainers":[{"name":"dhrupad-sah","email":"thedhrupad@gmail.com"}],"readme":"# @dhrupad-sah/exception-catcher\n\nAutomatically catch and report exceptions to Mira Sentinel with rich context and Loki log integration for AI-powered debugging and automatic fix generation.\n\n## Features\n\n- 🚨 **Automatic Exception Catching** - Monitors uncaught exceptions and unhandled rejections\n- 📊 **Rich Context** - Collects system info, memory usage, and custom context\n- 🔍 **Loki Integration** - Correlates exceptions with log data for enhanced debugging\n- 🤖 **AI-Powered Fixes** - Integrates with Claude Code for automatic issue resolution\n- 📋 **GitHub Integration** - Automatically creates issues and pull requests\n- 🔄 **Retry Logic** - Robust error reporting with configurable retries\n- 🎯 **Flexible Filtering** - Custom error filtering and context enrichment\n\n## Installation\n\n```bash\nnpm install @dhrupad-sah/exception-catcher\n```\n\n## Quick Start\n\n### Fastify Integration (Recommended for APIs)\n\n```typescript\nimport Fastify from 'fastify'\nimport { fastifyMiraSentinel } from '@dhrupad-sah/exception-catcher'\n\nconst fastify = Fastify({ logger: true })\n\n// Register the plugin - automatically handles all HTTP route exceptions\nawait fastify.register(fastifyMiraSentinel, {\n  sentinelUrl: process.env.MIRA_SENTINEL_URL!,\n  serviceName: 'api-service',\n  repo: 'company/api-service',\n  \n  // Optional: Skip client errors\n  skipStatusCodes: [400, 401, 403, 404],\n  \n  // Optional: Extract custom context\n  extractRequestContext: (request) => ({\n    userId: request.headers['x-user-id'],\n    traceId: request.headers['x-trace-id']\n  })\n})\n\n// Your routes - exceptions are automatically caught and reported\nfastify.get('/users/:id', async (request, reply) => {\n  const user = await getUser(request.params.id) // Any error here is caught\n  return user\n})\n\nawait fastify.listen({ port: 3000 })\n```\n\n### Basic Usage (Non-Fastify Apps)\n\n```typescript\nimport { MiraSentinelExceptionCatcher } from '@dhrupad-sah/exception-catcher'\n\nconst catcher = new MiraSentinelExceptionCatcher({\n  sentinelUrl: 'https://your-sentinel-instance.com',\n  serviceName: 'api-service',\n  repo: 'company/api-service'\n})\n\n// Initialize and start monitoring\ncatcher.initialize()\n\n// That's it! All exceptions are now automatically caught and reported\n```\n\n### Environment-Based Auto-Initialization\n\n```typescript\nimport { autoInitialize } from '@dhrupad-sah/exception-catcher'\n\n// Set environment variables:\n// MIRA_SENTINEL_URL=https://your-sentinel-instance.com\n// MIRA_SERVICE_NAME=api-service  \n// MIRA_REPO=company/api-service\n\nconst catcher = autoInitialize()\n// Automatically initializes if environment variables are set\n```\n\n### Advanced Configuration\n\n```typescript\nimport { MiraSentinelExceptionCatcher } from '@dhrupad-sah/exception-catcher'\n\nconst catcher = new MiraSentinelExceptionCatcher({\n  sentinelUrl: 'https://your-sentinel-instance.com',\n  serviceName: 'api-service',\n  repo: 'company/api-service',\n  apiKey: 'your-api-key', // Optional authentication\n  \n  // Custom error filtering\n  shouldCatchError: (error) => {\n    // Skip test errors\n    return !error.message.includes('test')\n  },\n  \n  // Enrich context with custom data\n  enrichContext: (error, context) => {\n    return {\n      userId: getCurrentUserId(),\n      requestId: getCurrentRequestId(),\n      version: process.env.APP_VERSION\n    }\n  },\n  \n  // Configure retries\n  retry: {\n    attempts: 5,\n    delay: 2000\n  }\n})\n\ncatcher.initialize()\n```\n\n## Manual Exception Reporting\n\n```typescript\ntry {\n  // Some risky operation\n  await processPayment(paymentData)\n} catch (error) {\n  // Manually report with additional context\n  await catcher.reportException(error, {\n    context: {\n      paymentId: paymentData.id,\n      userId: paymentData.userId,\n      amount: paymentData.amount\n    },\n    tags: ['payment', 'critical'],\n    severity: 'high'\n  })\n  \n  throw error // Re-throw if needed\n}\n```\n\n## Event Handling\n\n```typescript\ncatcher.on('exception-caught', (error, context) => {\n  console.log('Exception caught:', error.message)\n})\n\ncatcher.on('exception-sent', (context, response) => {\n  console.log('Exception reported:', response.jobId)\n})\n\ncatcher.on('exception-failed', (error, context, reason) => {\n  console.error('Failed to report exception:', reason)\n})\n```\n\n## Integration with Express.js\n\n```typescript\nimport express from 'express'\nimport { MiraSentinelExceptionCatcher } from '@dhrupad-sah/exception-catcher'\n\nconst app = express()\n\nconst catcher = new MiraSentinelExceptionCatcher({\n  sentinelUrl: process.env.MIRA_SENTINEL_URL!,\n  serviceName: 'express-api',\n  repo: 'company/express-api',\n  \n  // Enrich with Express context\n  enrichContext: (error, context) => {\n    const req = (error as any).req\n    return req ? {\n      method: req.method,\n      url: req.url,\n      headers: req.headers,\n      userAgent: req.get('User-Agent'),\n      ip: req.ip\n    } : {}\n  }\n})\n\ncatcher.initialize()\n\n// Your routes here\napp.get('/api/users', async (req, res) => {\n  try {\n    const users = await getUsers()\n    res.json(users)\n  } catch (error) {\n    // Attach request context to error\n    ;(error as any).req = req\n    \n    // Report with additional context\n    await catcher.reportException(error as Error, {\n      context: {\n        endpoint: '/api/users',\n        method: req.method,\n        query: req.query\n      },\n      tags: ['api', 'users']\n    })\n    \n    res.status(500).json({ error: 'Internal server error' })\n  }\n})\n\napp.listen(3000)\n```\n\n## Integration with Fastify\n\n### **Option 1: Fastify Plugin (Recommended)**\n\n```typescript\nimport Fastify from 'fastify'\nimport { fastifyMiraSentinel } from '@dhrupad-sah/exception-catcher'\n\nconst fastify = Fastify({ logger: true })\n\n// Register the plugin - automatically handles all HTTP route exceptions\nawait fastify.register(fastifyMiraSentinel, {\n  sentinelUrl: process.env.MIRA_SENTINEL_URL!,\n  serviceName: 'fastify-api',\n  repo: 'company/fastify-api',\n  \n  // Optional configurations\n  includeHeaders: true,\n  includeBody: false, // Be careful with sensitive data\n  skipStatusCodes: [400, 401, 403, 404], // Don't report client errors\n  \n  // Custom request context extraction\n  extractRequestContext: (request) => ({\n    userId: request.headers['x-user-id'],\n    tenantId: request.headers['x-tenant-id'],\n    traceId: request.headers['x-trace-id']\n  })\n})\n\n// Your routes - exceptions are automatically caught and reported\nfastify.get('/users/:id', async (request, reply) => {\n  const user = await getUser(request.params.id) // Any error here is caught\n  return user\n})\n\n// Manual exception reporting is also available\nfastify.get('/manual-report', async (request, reply) => {\n  try {\n    await riskyOperation()\n  } catch (error) {\n    await fastify.miraSentinel.reportException(error, {\n      context: { operation: 'risky' }\n    })\n    throw error // Re-throw to send HTTP error response\n  }\n})\n\nawait fastify.listen({ port: 3000 })\n```\n\n### **Option 2: Manual Integration**\n\n```typescript\nimport Fastify from 'fastify'\nimport { MiraSentinelExceptionCatcher } from '@dhrupad-sah/exception-catcher'\n\nconst fastify = Fastify({ logger: true })\n\nconst catcher = new MiraSentinelExceptionCatcher({\n  sentinelUrl: process.env.MIRA_SENTINEL_URL!,\n  serviceName: 'fastify-api',\n  repo: 'company/fastify-api'\n})\n\ncatcher.initialize()\n\n// Global error handler\nfastify.setErrorHandler(async (error, request, reply) => {\n  await catcher.reportException(error, {\n    context: {\n      method: request.method,\n      url: request.url,\n      params: request.params,\n      query: request.query,\n      headers: request.headers\n    },\n    tags: ['fastify', 'api-error']\n  })\n  \n  reply.status(500).send({ error: 'Internal Server Error' })\n})\n\nfastify.listen({ port: 3000 })\n```\n\n## Environment Variables\n\n| Variable | Description | Required |\n|----------|-------------|----------|\n| `MIRA_SENTINEL_URL` | URL of your Mira Sentinel instance | Yes |\n| `MIRA_SERVICE_NAME` | Name of your service | Yes |\n| `MIRA_REPO` | GitHub repository (owner/repo) | Yes |\n| `MIRA_API_KEY` | API key for authentication | No |\n| `MIRA_ENABLED` | Enable/disable (default: true) | No |\n\n## Configuration Options\n\n| Option | Type | Description | Default |\n|--------|------|-------------|---------|\n| `sentinelUrl` | string | Mira Sentinel instance URL | Required |\n| `serviceName` | string | Service name for Loki correlation | Required |\n| `repo` | string | GitHub repository (owner/repo) | Required |\n| `apiKey` | string | Optional API key | undefined |\n| `enabled` | boolean | Enable/disable catching | true |\n| `timeout` | number | HTTP timeout (ms) | 10000 |\n| `shouldCatchError` | function | Custom error filter | () => true |\n| `enrichContext` | function | Custom context enrichment | () => ({}) |\n| `retry.attempts` | number | Retry attempts | 3 |\n| `retry.delay` | number | Retry delay (ms) | 1000 |\n\n## How It Works\n\n1. **Exception Occurs** - Your service throws an exception\n2. **Context Collection** - Rich context is automatically collected:\n   - Error message and stack trace\n   - System information (Node.js version, memory, CPU)\n   - Timestamp for Loki correlation\n   - Custom context from your application\n3. **Sent to Mira Sentinel** - Exception data is sent to your Sentinel instance\n4. **Loki Integration** - Sentinel queries Loki logs around the exception time\n5. **AI Analysis** - Claude Code analyzes the exception + log context\n6. **GitHub Integration** - Issue and PR are automatically created\n7. **Timeline Analysis** - Full timeline of events leading to the exception\n\n## Best Practices\n\n### 1. Service Naming\nUse consistent service names that match your Loki log labels:\n\n```typescript\n// Good - matches Loki service label\nserviceName: 'api-gateway'\n\n// Bad - doesn't match logs\nserviceName: 'my-awesome-service'\n```\n\n### 2. Error Filtering\nFilter out noise to focus on actionable exceptions:\n\n```typescript\nshouldCatchError: (error) => {\n  // Skip test environments\n  if (process.env.NODE_ENV === 'test') return false\n  \n  // Skip known non-critical errors\n  if (error.message.includes('ECONNRESET')) return false\n  \n  // Skip client errors (4xx)\n  if (error.name === 'ValidationError') return false\n  \n  return true\n}\n```\n\n### 3. Context Enrichment\nAdd meaningful context for better debugging:\n\n```typescript\nenrichContext: (error, context) => {\n  return {\n    // Business context\n    tenantId: getCurrentTenant(),\n    feature: getCurrentFeature(),\n    \n    // Technical context\n    version: process.env.APP_VERSION,\n    deployment: process.env.DEPLOYMENT_ID,\n    \n    // Performance context\n    responseTime: getResponseTime(),\n    queueSize: getQueueSize()\n  }\n}\n```\n\n### 4. Graceful Shutdown\nAlways clean up on process exit:\n\n```typescript\nconst catcher = new MiraSentinelExceptionCatcher(config)\ncatcher.initialize()\n\nprocess.on('SIGTERM', () => {\n  catcher.shutdown()\n  process.exit(0)\n})\n```\n\n## Testing\n\nTest your integration:\n\n```typescript\nconst catcher = new MiraSentinelExceptionCatcher(config)\ncatcher.initialize()\n\n// Test connection\nconst isConnected = await catcher.testConnection()\nconsole.log('Connected:', isConnected)\n\n// Test exception reporting\nawait catcher.reportException(new Error('Test error'), {\n  context: { test: true },\n  tags: ['test']\n})\n```\n\n## License\n\nMIT\n\n## Support\n\nFor support, please create an issue in the [GitHub repository](https://github.com/your-org/mira-sentinel-exception-catcher).","readmeFilename":"README.md"}