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

Function eventFromException

packages/browser/src/eventbuilder.ts:227–241  ·  view source on GitHub ↗
(
  stackParser: StackParser,
  exception: unknown,
  hint?: EventHint,
  attachStacktrace?: boolean,
)

Source from the content-addressed store, hash-verified

225 * @hidden
226 */
227export function eventFromException(
228 stackParser: StackParser,
229 exception: unknown,
230 hint?: EventHint,
231 attachStacktrace?: boolean,
232): PromiseLike<Event> {
233 const syntheticException = hint?.syntheticException || undefined;
234 const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);
235 addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }
236 event.level = 'error';
237 if (hint?.event_id) {
238 event.event_id = hint.event_id;
239 }
240 return resolvedSyncPromise(event);
241}
242
243/**
244 * Builds and Event from a Message

Callers 1

eventFromExceptionMethod · 0.90

Calls 3

addExceptionMechanismFunction · 0.85
resolvedSyncPromiseFunction · 0.85
eventFromUnknownInputFunction · 0.70

Tested by

no test coverage detected