{"version":3,"file":"chunk.6rjbbFJh.js","sources":["../../src/utils/handleError.ts"],"sourcesContent":["const handleError = (error: any) => {\n const errorDetail = error.response?.data?.detail;\n const errorMessage = error.response?.data?.message;\n const otherError = error.response?.data;\n\n if (errorDetail) return errorDetail;\n if (errorMessage) return errorMessage;\n\n if (typeof otherError === 'object') {\n const errorList = Object.values(otherError);\n const firstError = errorList[0] as any;\n\n if (typeof firstError === 'string') {\n return firstError;\n }\n\n const errorCleaned = JSON.stringify(firstError).replace(/[\"\\][]/g, '');\n\n return errorCleaned;\n }\n\n return error.message;\n};\n\nexport default handleError;\n"],"names":["handleError","error","_a","_b","_c","_d","_e","errorDetail","errorMessage","otherError","firstError"],"mappings":"AAAM,MAAAA,EAAeC,GAAe,CAA9B,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EACI,MAAAC,GAAcJ,GAAAD,EAAAD,EAAM,WAAN,YAAAC,EAAgB,OAAhB,YAAAC,EAAsB,OACpCK,GAAeH,GAAAD,EAAAH,EAAM,WAAN,YAAAG,EAAgB,OAAhB,YAAAC,EAAsB,QACrCI,GAAaH,EAAAL,EAAM,WAAN,YAAAK,EAAgB,KAE/B,GAAAC,EAAoB,OAAAA,EACpB,GAAAC,EAAqB,OAAAA,EAErB,GAAA,OAAOC,GAAe,SAAU,CAE1B,MAAAC,EADY,OAAO,OAAOD,CAAU,EACb,CAAC,EAE1B,OAAA,OAAOC,GAAe,SACfA,EAGU,KAAK,UAAUA,CAAU,EAAE,QAAQ,UAAW,EAAE,CAE9D,CAGX,OAAOT,EAAM,OACjB"}