decord/beta/source/utils/ErrorUtils.tsx
github-actions 9b6fea255e chore: update source for beta 346.12
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-18 19:45:33 +00:00

46 lines
1.3 KiB
TypeScript

// Module ID: 13437
// Function ID: 13438
// Name: ErrorUtils
// Dependencies: [13438, 2]
// Exports: getUnderlyingIOSError, serializeError
// Module 13437 (ErrorUtils)
import _mod13438 from "module_13438" /* 13438 */;
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 {
let tmp3 = getUnderlyingIOSExceptionRecursively(message);
if (tmp3 == null) {
tmp3 = null;
}
return tmp3;
} catch (err) {
return null;
}
};
export const serializeError = function serializeError(arg0) {
let error = arg0;
if (!Boolean(arg0)) {
const _Error = Error;
error = new Error("unknown error");
}
let error1 = error;
if (typeof error !== "object") {
const _Error2 = Error;
const _String = String;
error1 = new Error(String(error));
}
return JSON.stringify(_mod13438.normalizeToSize(error1));
};