(value: unknown, context?: string)
| 151 | } |
| 152 | |
| 153 | export function SentryCapture(value: unknown, context?: string) { |
| 154 | if (value instanceof Error) { |
| 155 | if (context) { |
| 156 | value.message += `\nSentryCapture Context: ${context}`; |
| 157 | } |
| 158 | Sentry.captureException(value); |
| 159 | } else { |
| 160 | const e = new Error(); |
| 161 | const trace = parse(e); |
| 162 | Sentry.captureMessage( |
| 163 | 'Non-Error capture:\n' + |
| 164 | (context ? `Context: ${context}\n` : '') + |
| 165 | `Data:\n${JSON.stringify(value)}\n` + |
| 166 | 'Trace:\n' + |
| 167 | trace |
| 168 | .map(frame => `${frame.functionName} ${frame.fileName}:${frame.lineNumber}:${frame.columnNumber}`) |
| 169 | .join('\n'), |
| 170 | ); |
| 171 | } |
| 172 | } |
no test coverage detected