MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / isWebAssemblyException

Function isWebAssemblyException

packages/browser/src/eventbuilder.ts:165–175  ·  view source on GitHub ↗
(exception: unknown)

Source from the content-addressed store, hash-verified

163// https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception
164// @ts-expect-error - WebAssembly.Exception is a valid class
165function isWebAssemblyException(exception: unknown): exception is WebAssembly.Exception {
166 // Check for support
167 // @ts-expect-error - WebAssembly.Exception is a valid class
168 // oxlint-disable-next-line typescript/prefer-optional-chain
169 if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') {
170 // @ts-expect-error - WebAssembly.Exception is a valid class
171 return exception instanceof WebAssembly.Exception;
172 } else {
173 return false;
174 }
175}
176
177/**
178 * Extracts from errors what we use as the exception `type` in error events.

Callers 2

extractTypeFunction · 0.85
extractMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected