Overview
axios.config.ts treats CORS failures and generic network errors identically. CORS rejections often indicate a misconfigured backend or a man-in-the-middle scenario and should be flagged separately in monitoring.
Specifications
Features:
- Detect CORS errors by checking
error.message for "Network Error" with a 0 status code on non-GET requests
- Log CORS failures to Sentry with a distinct
cors_failure tag
Tasks:
- Add CORS detection logic in the response error interceptor
- Create a distinct Sentry issue category for CORS errors
- Write a test that mocks a CORS response and checks the Sentry tag
Impacted Files:
src/config/axios.config.ts
Acceptance Criteria
- CORS failures appear in Sentry under a unique
cors_failure tag
- Generic network errors continue to use existing error handling
- Test confirms correct categorisation
Overview
axios.config.tstreats CORS failures and generic network errors identically. CORS rejections often indicate a misconfigured backend or a man-in-the-middle scenario and should be flagged separately in monitoring.Specifications
Features:
error.messagefor "Network Error" with a 0 status code on non-GET requestscors_failuretagTasks:
Impacted Files:
src/config/axios.config.tsAcceptance Criteria
cors_failuretag