Files
super-app/App/common/utilities/ErrorUtils.ts
Mehul Garg 2885b93644 NTP-2052 | Mehul | Credit card flow revamp (#12126)
Co-authored-by: Mohit Rajput <mohit.rajput@navi.com>
Co-authored-by: sidharthbamba <sidharth.bamba@navi.com>
2024-09-10 18:28:19 +00:00

12 lines
413 B
TypeScript

import { AnalyticsGlobalErrorTypeConstant } from "../constants";
export const getErrorTypeFromStatusCode = (statusCode: number) => {
const statusCodeforGenericError = [20, 23, 24, 401, 404];
if (statusCodeforGenericError.includes(statusCode) || statusCode >= 500) {
return AnalyticsGlobalErrorTypeConstant.GLOBAL_GENERIC_ERRORS;
}
return AnalyticsGlobalErrorTypeConstant.GLOBAL_INTERNAL_ERRORS;
};