Skip to content

[Bug] axios.config.ts interceptor can crash if logger throws — no guard around logging call #794

Description

@RUKAYAT-CODER

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions