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

Function exceptionFromError

packages/core/src/utils/eventbuilder.ts:47–59  ·  view source on GitHub ↗
(stackParser: StackParser, error: Error)

Source from the content-addressed store, hash-verified

45 * Extracts stack frames from the error and builds a Sentry Exception
46 */
47export function exceptionFromError(stackParser: StackParser, error: Error): Exception {
48 const exception: Exception = {
49 type: error.name || error.constructor.name,
50 value: _enhanceErrorWithSentryInfo(error),
51 };
52
53 const frames = parseStackFrames(stackParser, error);
54 if (frames.length) {
55 exception.stacktrace = { frames };
56 }
57
58 return exception;
59}
60
61/** If a plain object has a property that is an `Error`, return this error. */
62function getErrorPropertyFromObject(obj: Record<string, unknown>): Error | undefined {

Callers 2

eventFromUnknownInputFunction · 0.70

Calls 2

parseStackFramesFunction · 0.70

Tested by

no test coverage detected