decord/source/modules/auth/getAuthenticationErrorsFromAPIError.tsx
github-actions 20a21ad13f chore: update source for alpha 346.5
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4791.js (118.4 MB)
2026-09-11 19:12:58 +00:00

41 lines
1.3 KiB
TypeScript

// Module ID: 7019
// Function ID: 7020
// Name: getAuthenticationErrorsFromAPIError
// Dependencies: [2]
// Exports: getAuthenticationErrorsFromAPIError, getAuthenticationErrorsFromV6OrEarlierAPIError
// Module 7019 (getAuthenticationErrorsFromAPIError)
import size from "module_2" /* 2 */;
const result = size.fileFinishedImporting("modules/auth/getAuthenticationErrorsFromAPIError.tsx");
export const getAuthenticationErrorsFromAPIError = function getAuthenticationErrorsFromAPIError(error) {
const obj = { error_code: error.code };
if (null != error.errors) {
const _Object = Object;
const keys = Object.keys(error.errors);
for (const item10017 of keys) {
let items = [arg0.getFirstFieldErrorMessage(item10017)];
obj[item10017] = items;
continue;
}
return obj;
} else {
obj.message = error.message;
if (null != error.retryAfter) {
obj.retry_after = error.retryAfter;
}
return obj;
}
};
export const getAuthenticationErrorsFromV6OrEarlierAPIError = function getAuthenticationErrorsFromV6OrEarlierAPIError(error) {
if (Object.keys(error.fields).length > 0) {
return error.fields;
} else {
const obj = { message: error.message };
if (null != error.retryAfter) {
obj.retry_after = error.retryAfter;
}
return obj;
}
};