decord/source/275_getExtendedError.js

37 lines
1.3 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 275
// Function ID: 3429
// Name: getExtendedError
2026-07-23 10:11:24 +00:00
// Dependencies: [31, 183]
2026-07-20 16:05:17 +00:00
// Exports: onCaughtError, onRecoverableError, onUncaughtError
// Module 275 (getExtendedError)
2026-07-23 10:11:24 +00:00
import "result";
const require = arg1;
2026-07-20 16:05:17 +00:00
function getExtendedError(value, componentStack) {
if (value instanceof Error) {
value.componentStack = componentStack.componentStack;
value.isComponentError = true;
} else if ("string" === typeof value) {
2026-07-23 10:11:24 +00:00
const SyntheticError2 = require(183) /* _isNativeReflectConstruct */.SyntheticError;
2026-07-20 16:05:17 +00:00
const prototype2 = SyntheticError2.prototype;
let syntheticError2 = new SyntheticError2(value);
} else {
2026-07-23 10:11:24 +00:00
const SyntheticError = require(183) /* _isNativeReflectConstruct */.SyntheticError;
2026-07-20 16:05:17 +00:00
const prototype = SyntheticError.prototype;
syntheticError2 = new SyntheticError("Unspecified error");
}
}
export const onUncaughtError = function onUncaughtError(value, componentStack) {
const tmp = getExtendedError(value, componentStack);
2026-07-23 10:11:24 +00:00
importDefault(183).handleException(tmp, true);
2026-07-20 16:05:17 +00:00
};
export const onCaughtError = function onCaughtError(value, componentStack) {
const tmp = getExtendedError(value, componentStack);
2026-07-23 10:11:24 +00:00
importDefault(183).handleException(tmp, false);
2026-07-20 16:05:17 +00:00
};
export const onRecoverableError = function onRecoverableError(value, componentStack) {
console.warn(getExtendedError(value, componentStack));
};