function n(s){if(!s)return"Unknown error";if(s?.name==="ZodError")return Array.isArray(s.errors)?s.errors.map(e=>e.message).join(`
`):"Validation failed";if(Array.isArray(s?.details))return`Validate failed: ${s.details.map(a=>{const t=a.message.replace(/["]/g,"'");return`${a.path.join(".")}: ${t}`}).join(";")}`;if(Array.isArray(s?.errors))return s.errors.map(e=>e.msg||e.message).join(`
`);if(Array.isArray(s?.constraints))return Object.values(s.constraints).join(`
`);if(s?.keyword==="validation")return s.message||"Validation error";if(Array.isArray(s?.errors))return s.errors.map(e=>e.message).join(`
`);if(s instanceof TypeError&&s.message.includes("fetch"))return"Network error: Failed to fetch";if(s?.name==="FetchError")return s.message||"Fetch error occurred";if(s?.isAxiosError){if(s.response?.data){if(s.response.data.message)return s.response.data.message;if(s.response.data.error)return s.response.data.error;const e=typeof s.response.data=="string"?s.response.data.slice(0,200):JSON.stringify(s.response.data);return`Request failed: ${s.response.status} ${s.response.statusText}: ${e}`}return s.message||"Request failed"}if(s?.response){if(s.response.error)return s.response.error;if(s.response.data?.message)return s.response.data.message;if(s.response.data?.error)return s.response.data.error;const e=typeof s.response.data=="string"?s.response.data.slice(0,200):JSON.stringify(s.response.data);return`Request failed: ${s.response.status} ${s.response.statusText}: ${e}`}return s.message||String(s)}export{n as f};
