13 lines
355 B
13 lines
355 B
export const handleApiError = (error: any, endpoint: string) => {
|
|
if (process.env.VITE_PLATFORM === 'capacitor') {
|
|
console.error(`[Capacitor API Error] ${endpoint}:`, error);
|
|
}
|
|
|
|
// Specific handling for rate limits
|
|
if (error.response?.status === 400) {
|
|
console.warn(`[Rate Limit] ${endpoint}`);
|
|
return null;
|
|
}
|
|
|
|
throw error;
|
|
};
|