(value: unknown, context?: string)
| 62 | } |
| 63 | |
| 64 | export function SentryCapture(value: unknown, context?: string) { |
| 65 | if (value instanceof Error) { |
| 66 | if (context) { |
| 67 | value.message += `\nSentryCapture Context: ${context}`; |
| 68 | } |
| 69 | Sentry.captureException(value); |
| 70 | } else { |
| 71 | const e = new Error(); |
| 72 | const trace = parse(e); |
| 73 | Sentry.captureMessage( |
| 74 | 'Non-Error capture:\n' + |
| 75 | (context ? `Context: ${context}\n` : '') + |
| 76 | `Data:\n${JSON.stringify(value)}\n` + |
| 77 | 'Trace:\n' + |
| 78 | trace |
| 79 | .map(frame => `${frame.functionName} ${frame.fileName}:${frame.lineNumber}:${frame.columnNumber}`) |
| 80 | .join('\n'), |
| 81 | ); |
| 82 | } |
| 83 | } |
no test coverage detected