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

Function isError

packages/core/src/utils/is.ts:18–28  ·  view source on GitHub ↗
(wat: unknown)

Source from the content-addressed store, hash-verified

16 * @returns A boolean representing the result.
17 */
18export function isError(wat: unknown): wat is Error {
19 switch (objectToString.call(wat)) {
20 case '[object Error]':
21 case '[object Exception]':
22 case '[object DOMException]':
23 case '[object WebAssembly.Exception]':
24 return true;
25 default:
26 return isInstanceOf(wat, Error);
27 }
28}
29/**
30 * Checks whether given value is an instance of the given built-in class.
31 *

Callers 14

is.test.tsFile · 0.90
hasSentryFetchUrlHostFunction · 0.90
getExceptionFunction · 0.90
convertToPlainObjectFunction · 0.90
instrumentFetchFunction · 0.90
_extractErrorDataFunction · 0.90
_patchNextMethod · 0.90

Calls 2

isInstanceOfFunction · 0.85
callMethod · 0.80

Tested by

no test coverage detected