Summary
Enhance error handling in HttpTransport to map common HTTP error statuses (like 401 Unauthorized or 429 Too Many Requests) to specific, descriptive messages rather than generic HTTP errors.
Why
If the remote logging endpoint rejects the logs with 401 or throttling (429), developers benefit from seeing the exact cause in their application's warning/error streams rather than a vague error description.
Scope
- Update response code handling in
src/transports/HttpTransport.ts.
- Map
429 response to a descriptive warning indicating rate-limiting.
- Map
401/403 to authentication setup validation warning.
- Add corresponding unit tests in
tests/transports/HttpTransport.test.ts.
Acceptance Criteria
- Clear, specific error messages are printed/passed to
onError handler for 401, 403, and 429 status codes.
- All new tests pass.
Summary
Enhance error handling in
HttpTransportto map common HTTP error statuses (like401 Unauthorizedor429 Too Many Requests) to specific, descriptive messages rather than generic HTTP errors.Why
If the remote logging endpoint rejects the logs with
401or throttling (429), developers benefit from seeing the exact cause in their application's warning/error streams rather than a vague error description.Scope
src/transports/HttpTransport.ts.429response to a descriptive warning indicating rate-limiting.401/403to authentication setup validation warning.tests/transports/HttpTransport.test.ts.Acceptance Criteria
onErrorhandler for401,403, and429status codes.