2026-09-15 14:23:42 +00:00
|
|
|
// Module ID: 7053
|
|
|
|
|
// Function ID: 7054
|
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-09-15 14:23:42 +00:00
|
|
|
// Module 7053 (getAuthenticationErrorsFromAPIError)
|
2026-09-10 05:38:07 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-08-24 06:08:38 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
const result = size.fileFinishedImporting("modules/auth/getAuthenticationErrorsFromAPIError.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
export const getAuthenticationErrorsFromAPIError = function getAuthenticationErrorsFromAPIError(error) {
|
|
|
|
|
const obj = { error_code: error.code };
|
|
|
|
|
if (null != error.errors) {
|
2026-07-20 16:05:17 +00:00
|
|
|
const _Object = Object;
|
2026-09-10 05:38:07 +00:00
|
|
|
const keys = Object.keys(error.errors);
|
2026-07-29 08:29:29 +00:00
|
|
|
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-09-10 05:38:07 +00:00
|
|
|
obj.message = error.message;
|
|
|
|
|
if (null != error.retryAfter) {
|
|
|
|
|
obj.retry_after = error.retryAfter;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
};
|
2026-09-10 05:38:07 +00:00
|
|
|
export const getAuthenticationErrorsFromV6OrEarlierAPIError = function getAuthenticationErrorsFromV6OrEarlierAPIError(error) {
|
|
|
|
|
if (Object.keys(error.fields).length > 0) {
|
|
|
|
|
return error.fields;
|
2026-07-20 16:05:17 +00:00
|
|
|
} else {
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj = { message: error.message };
|
|
|
|
|
if (null != error.retryAfter) {
|
|
|
|
|
obj.retry_after = error.retryAfter;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
};
|