Symptom
If the API returns an error for fetching an incident, the app crashes with TypeError: Cannot read properties of undefined (reading 'clientName') instead of showing a clean error message.
Context
The frontend uses an IncidentApiClient that extends BaseApiClient. The base class has a handleError method that wraps errors with the client name for better debugging. The fetchIncident method chains .catch() to handle errors.
Hints
TypeScript
TypeScript ready
Test Output
▶
Click "Run Tests" to execute your code