57 lines
1.8 KiB
JavaScript
57 lines
1.8 KiB
JavaScript
// Metro module 1084 (f1085).
|
|
import { defineIntegration, getClient, withScope, captureMessage, supportsReportingObserver, GLOBAL_OBJ } from "./Module817";
|
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
value: "Module"
|
|
});
|
|
let c894_2 = new WeakMap();
|
|
export const reportingObserverIntegration = defineIntegration(function(r1 = {}) {
|
|
let types;
|
|
types = void 0;
|
|
const handler2 = function handler(a0) {
|
|
if (c894_2.has(getClient())) {
|
|
const _loop = function _loop(c28753_0) {
|
|
withScope((a0) => {
|
|
const setExtra = a0.setExtra;
|
|
setExtra.call(a0, "url", c28753_0.url);
|
|
const r20 = `ReportingObserver [${c28753_0.type}]`;
|
|
const body = c28753_0.body;
|
|
let r23 = "No details available";
|
|
if (body) {
|
|
const r10 = {};
|
|
const body2 = c28753_0.body;
|
|
for (const key in body2) {
|
|
r10[key] = c28753_0.body[key];
|
|
}
|
|
a0.setExtra("body", r10);
|
|
if (c28753_0.type === "crash") {
|
|
const body3 = c28753_0.body;
|
|
r23 = [body3.crashId || "", body3.reason || ""].join(" ").trim() || "No details available";
|
|
} else {
|
|
r23 = c28753_0.body.message || "No details available";
|
|
}
|
|
}
|
|
captureMessage(`${r20}: ${r23}`);
|
|
});
|
|
};
|
|
for (const item of a0) {
|
|
_loop(item);
|
|
}
|
|
}
|
|
};
|
|
types = r1.types || ["crash", "deprecation", "intervention"];
|
|
return {
|
|
name: "ReportingObserver",
|
|
setupOnce: () => {
|
|
if (supportsReportingObserver()) {
|
|
new GLOBAL_OBJ.ReportingObserver(handler2, {
|
|
buffered: true,
|
|
types
|
|
}).observe();
|
|
}
|
|
},
|
|
setup: (a0) => {
|
|
c894_2.set(a0, true);
|
|
}
|
|
};
|
|
});
|