33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
// Metro module 818 (f819).
|
|
import { getActiveSpan, getRootSpan } from "./spanToJSON";
|
|
import { DEBUG_BUILD } from "./Module823";
|
|
import { debug } from "./consoleSandbox";
|
|
import { SPAN_STATUS_ERROR } from "./Module840";
|
|
import { addGlobalErrorInstrumentationHandler } from "./instrumentError";
|
|
import { addGlobalUnhandledRejectionInstrumentationHandler } from "./instrumentUnhandledRejection";
|
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
value: "Module"
|
|
});
|
|
let c662_2 = false;
|
|
export function registerSpanErrorInstrumentation() {
|
|
if (!c662_2) {
|
|
const errorCallback = function errorCallback() {
|
|
const activeSpan = getActiveSpan();
|
|
const r3 = activeSpan && getRootSpan(activeSpan);
|
|
if (r3) {
|
|
if (DEBUG_BUILD) {
|
|
debug.log(`[Tracing] Root span: internal_error -> Global error occurred`);
|
|
}
|
|
r3.setStatus({
|
|
code: SPAN_STATUS_ERROR,
|
|
message: "internal_error"
|
|
});
|
|
}
|
|
};
|
|
errorCallback.tag = "sentry_tracingErrorCallback";
|
|
c662_2 = true;
|
|
addGlobalErrorInstrumentationHandler(errorCallback);
|
|
addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);
|
|
}
|
|
}
|