decord/alpha/source/utils/ErrorUtils.tsx

49 lines
1.4 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 13972
// Function ID: 13973
// Name: ErrorUtils
2026-10-13 12:43:34 +00:00
// Dependencies: [13973, 2]
2026-07-20 16:05:17 +00:00
// Exports: getUnderlyingIOSError, serializeError
2026-10-13 12:43:34 +00:00
// Module 13972 (ErrorUtils)
import _mod13973 from "module_13973" /* 13973 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
2026-07-20 16:05:17 +00:00
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");
2026-07-20 16:05:17 +00:00
export const getUnderlyingIOSError = function getUnderlyingIOSError(message) {
2026-07-29 08:29:29 +00:00
try {
2026-10-03 08:58:59 +00:00
const tmp3 = getUnderlyingIOSExceptionRecursively(message) ?? null;
2026-07-29 08:29:29 +00:00
return tmp3;
} catch (err) {
return null;
2026-07-20 16:05:17 +00:00
}
};
export const serializeError = function serializeError(arg0) {
let error = arg0;
2026-07-20 16:05:17 +00:00
if (!Boolean(arg0)) {
const _Error = Error;
2026-10-03 08:58:59 +00:00
const self = this;
const self2 = this;
2026-07-20 16:05:17 +00:00
error = new Error("unknown error");
}
let error1 = error;
2026-08-04 21:03:28 +00:00
if (typeof error !== "object") {
2026-07-20 16:05:17 +00:00
const _Error2 = Error;
const _String = String;
2026-10-03 08:58:59 +00:00
const self3 = this;
const self4 = this;
2026-07-20 16:05:17 +00:00
error1 = new Error(String(error));
}
2026-10-13 12:43:34 +00:00
const obj = _mod13973;
2026-10-03 08:58:59 +00:00
return stringify(obj.normalizeToSize(error1));
2026-07-20 16:05:17 +00:00
};