(exception: unknown)
| 212 | * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen) |
| 213 | */ |
| 214 | export function checkOrSetAlreadyCaught(exception: unknown): boolean { |
| 215 | if (isAlreadyCaptured(exception)) { |
| 216 | return true; |
| 217 | } |
| 218 | |
| 219 | try { |
| 220 | // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the |
| 221 | // `ExtraErrorData` integration |
| 222 | addNonEnumerableProperty(exception as { [key: string]: unknown }, '__sentry_captured__', true); |
| 223 | } catch { |
| 224 | // `exception` is a primitive, so we can't mark it seen |
| 225 | } |
| 226 | |
| 227 | return false; |
| 228 | } |
| 229 | |
| 230 | /** |
| 231 | * Checks whether we've already captured the given exception (note: not an identical exception - the very object). |
no test coverage detected