()
| 81 | let cachedSentry: SentryModule | null = null; |
| 82 | |
| 83 | function loadSentrySync(): SentryModule | null { |
| 84 | if (!isSentryEnabled() || isTestEnv()) { |
| 85 | return null; |
| 86 | } |
| 87 | if (cachedSentry) { |
| 88 | return cachedSentry; |
| 89 | } |
| 90 | try { |
| 91 | cachedSentry = require('@sentry/node') as SentryModule; |
| 92 | return cachedSentry; |
| 93 | } catch { |
| 94 | return null; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | function withSentry(cb: (s: SentryModule) => void): void { |
| 99 | const s = loadSentrySync(); |
no test coverage detected