decord/stable/source/utils/ErrorUtils.tsx

49 lines
1.4 KiB
TypeScript
Raw Normal View History

2026-10-06 22:12:49 +00:00
// Module ID: 12886
// Function ID: 12887
// Name: ErrorUtils
2026-10-06 22:12:49 +00:00
// Dependencies: [12887, 2]
// Exports: getUnderlyingIOSError, serializeError
2026-10-06 22:12:49 +00:00
// Module 12886 (ErrorUtils)
import _mod12887 from "module_12887" /* 12887 */;
import size from "module_2" /* 2 */;
function getUnderlyingIOSExceptionRecursively(NSUnderlyingError) {
if (null != NSUnderlyingError.userInfo.NSUnderlyingError) {
const tmp2 = getUnderlyingIOSExceptionRecursively(NSUnderlyingError.userInfo.NSUnderlyingError);
if (null != tmp2) {
return tmp2;
}
}
return NSUnderlyingError.userInfo.NSLocalizedDescription;
}
const result = size.fileFinishedImporting("utils/ErrorUtils.tsx");
export const getUnderlyingIOSError = function getUnderlyingIOSError(message) {
try {
2026-10-06 22:12:49 +00:00
const tmp3 = getUnderlyingIOSExceptionRecursively(message) ?? null;
return tmp3;
} catch (err) {
return null;
}
};
export const serializeError = function serializeError(arg0) {
let error = arg0;
if (!Boolean(arg0)) {
const _Error = Error;
2026-10-06 22:12:49 +00:00
const self = this;
const self2 = this;
error = new Error("unknown error");
}
let error1 = error;
if (typeof error !== "object") {
const _Error2 = Error;
const _String = String;
2026-10-06 22:12:49 +00:00
const self3 = this;
const self4 = this;
error1 = new Error(String(error));
}
2026-10-06 22:12:49 +00:00
const obj = _mod12887;
return stringify(obj.normalizeToSize(error1));
};