decord/source/923_captureError.js

38 lines
1.2 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 923
2026-07-24 07:16:23 +00:00
// Function ID: 10071
2026-07-20 16:05:17 +00:00
// Name: captureError
2026-07-23 10:11:24 +00:00
// Dependencies: [825, 796, 817, 845]
2026-07-20 16:05:17 +00:00
// Module 923 (captureError)
2026-07-23 10:11:24 +00:00
const require = arg1;
const dependencyMap = arg6;
2026-07-20 16:05:17 +00:00
Object.defineProperty(arg5, Symbol.toStringTag, { value: "Module" });
arg5.captureError = function captureError(error, prompt_execution, arg2) {
2026-07-23 10:11:24 +00:00
let obj = require(825) /* getCurrentScope */;
2026-07-20 16:05:17 +00:00
if (obj.getClient()) {
2026-07-23 10:11:24 +00:00
let obj1 = require(796) /* convertSpanLinksForEnvelope */;
2026-07-20 16:05:17 +00:00
const activeSpan = obj1.getActiveSpan();
let obj2 = activeSpan;
let isRecordingResult = tmp5;
if (null != activeSpan) {
isRecordingResult = obj2.isRecording();
}
if (isRecordingResult) {
2026-07-23 10:11:24 +00:00
obj = { code: require(817) /* getSpanStatusFromHttpCode */.SPAN_STATUS_ERROR, message: "internal_error" };
2026-07-20 16:05:17 +00:00
obj2.setStatus(obj);
}
obj = {};
2026-07-23 10:11:24 +00:00
obj1 = { type: "auto.ai.mcp_server", handled: false };
2026-07-20 16:05:17 +00:00
obj2 = {};
let str2 = prompt_execution;
if (!prompt_execution) {
str2 = "handler_execution";
}
obj2.error_type = str2;
obj1.data = Object.assign(obj2, arg2);
obj.mechanism = obj1;
2026-07-23 10:11:24 +00:00
require(845) /* captureCheckIn */.captureException(error, obj);
const obj5 = require(845) /* captureCheckIn */;
2026-07-20 16:05:17 +00:00
}
};