decord/source/modules/auth/getAuthenticationErrorsFromAPIError.tsx

41 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 8585
// Function ID: 8586
2026-07-20 16:05:17 +00:00
// Name: getAuthenticationErrorsFromAPIError
2026-07-23 10:11:24 +00:00
// Dependencies: [2]
2026-07-20 16:05:17 +00:00
// Exports: getAuthenticationErrorsFromAPIError, getAuthenticationErrorsFromV6OrEarlierAPIError
2026-08-15 05:55:55 +00:00
// Module 8585 (getAuthenticationErrorsFromAPIError)
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("modules/auth/getAuthenticationErrorsFromAPIError.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const getAuthenticationErrorsFromAPIError = function getAuthenticationErrorsFromAPIError(c6) {
const obj = { error_code: c6.code };
if (null != c6.errors) {
2026-07-20 16:05:17 +00:00
const _Object = Object;
2026-07-29 08:29:29 +00:00
const keys = Object.keys(c6.errors);
for (const item10017 of keys) {
let items = [arg0.getFirstFieldErrorMessage(item10017)];
obj[item10017] = items;
continue;
2026-07-20 16:05:17 +00:00
}
return obj;
} else {
2026-07-29 08:29:29 +00:00
obj.message = c6.message;
if (null != c6.retryAfter) {
obj.retry_after = c6.retryAfter;
2026-07-20 16:05:17 +00:00
}
return obj;
}
};
2026-07-29 08:29:29 +00:00
export const getAuthenticationErrorsFromV6OrEarlierAPIError = function getAuthenticationErrorsFromV6OrEarlierAPIError(closure_4) {
if (Object.keys(closure_4.fields).length > 0) {
return closure_4.fields;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj = { message: null };
obj[0] = closure_4.message;
if (null != closure_4.retryAfter) {
obj.retry_after = closure_4.retryAfter;
2026-07-20 16:05:17 +00:00
}
return obj;
}
};