decord/source/10057_isErrorWithCode.js

22 lines
594 B
JavaScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 10057
// Function ID: 10058
2026-07-20 16:05:17 +00:00
// Name: isErrorWithCode
// Dependencies: []
2026-08-05 07:35:12 +00:00
// Module 10057 (isErrorWithCode)
2026-07-29 08:29:29 +00:00
arg5.errorCodes = Object.freeze({ OPERATION_CANCELED: "OPERATION_CANCELED", IN_PROGRESS: "ASYNC_OP_IN_PROGRESS", UNABLE_TO_OPEN_FILE_TYPE: "UNABLE_TO_OPEN_FILE_TYPE", NULL_PRESENTER: "NULL_PRESENTER" });
2026-08-04 21:03:28 +00:00
arg5.isErrorWithCode = (obj) => {
let tmp = obj instanceof Error;
2026-07-20 16:05:17 +00:00
if (!tmp) {
2026-08-04 21:03:28 +00:00
let tmp2 = typeof obj === "object";
if (typeof obj === "object") {
tmp2 = null != obj;
2026-07-20 16:05:17 +00:00
}
tmp = tmp2;
}
if (tmp) {
2026-08-04 21:03:28 +00:00
tmp = "code" in obj;
2026-07-20 16:05:17 +00:00
}
return tmp;
};