You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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;
|
|
};
|