decord/source/289_getExtendedError.js

40 lines
1.4 KiB
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 289
// Function ID: 290
// Name: getExtendedError
// Dependencies: [19, 189]
// Exports: onCaughtError, onRecoverableError, onUncaughtError
// Module 289 (getExtendedError)
2026-08-24 06:08:38 +00:00
import noopAll from "noop" /* 19 */;
import _isNativeReflectConstruct from "_isNativeReflectConstruct" /* 189 */;
import _isNativeReflectConstructDefault from "_isNativeReflectConstruct" /* 189 */;
2026-07-29 08:29:29 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
function getExtendedError(value, componentStack) {
if (value instanceof Error) {
try {
value.componentStack = componentStack.componentStack;
value.isComponentError = true;
return value;
} catch (err) {
}
2026-08-04 21:03:28 +00:00
} else if (typeof value === "string") {
2026-08-24 06:08:38 +00:00
let syntheticError = new _isNativeReflectConstruct.SyntheticError(value);
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
syntheticError = new _isNativeReflectConstruct.SyntheticError("Unspecified error");
2026-07-29 08:29:29 +00:00
}
}
2026-08-24 06:08:38 +00:00
noopAll;
2026-07-29 08:29:29 +00:00
export const onUncaughtError = function onUncaughtError(value, componentStack) {
const tmp = getExtendedError(value, componentStack);
2026-08-24 06:08:38 +00:00
_isNativeReflectConstructDefault.handleException(tmp, true);
2026-07-29 08:29:29 +00:00
};
export const onCaughtError = function onCaughtError(value, componentStack) {
const tmp = getExtendedError(value, componentStack);
2026-08-24 06:08:38 +00:00
_isNativeReflectConstructDefault.handleException(tmp, false);
2026-07-29 08:29:29 +00:00
};
export const onRecoverableError = function onRecoverableError(value, componentStack) {
console.warn(getExtendedError(value, componentStack));
};