(e: unknown)
| 44 | }; |
| 45 | |
| 46 | function sendErrorToSentry(e: unknown): unknown { |
| 47 | // In case we have a primitive, wrap it in the equivalent wrapper class (string -> String, etc.) so that we can |
| 48 | // store a seen flag on it. |
| 49 | const objectifiedErr = objectify(e); |
| 50 | |
| 51 | captureException(objectifiedErr, { |
| 52 | mechanism: { |
| 53 | type: 'auto.middleware.astro', |
| 54 | handled: false, |
| 55 | }, |
| 56 | }); |
| 57 | |
| 58 | return objectifiedErr; |
| 59 | } |
| 60 | |
| 61 | type AstroLocalsWithSentry = Record<string, unknown> & { |
| 62 | __sentry_wrapped__?: boolean; |
no test coverage detected