Overview
The response error interceptor in axios.config.ts calls logging functions without a guard. If the logger itself throws (e.g., Sentry is not initialized, circular JSON reference), the interceptor crashes and the original error is lost.
Specifications
Features:
- Wrap all logging calls inside the interceptors with a try/catch
- Fall back to
console.error if the primary logger fails
Tasks:
- Add try/catch around each logger call in the interceptor
- Log the logger failure itself to
console.error
- Write a test that mocks the logger to throw and confirms the original request error is still handled
Impacted Files:
src/config/axios.config.ts
Acceptance Criteria
- Logger failure does not propagate to callers
- Original error is always surfaced correctly
- Test passes with a throwing logger mock
Overview
The response error interceptor in
axios.config.tscalls logging functions without a guard. If the logger itself throws (e.g., Sentry is not initialized, circular JSON reference), the interceptor crashes and the original error is lost.Specifications
Features:
console.errorif the primary logger failsTasks:
console.errorImpacted Files:
src/config/axios.config.tsAcceptance Criteria