• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-core-sdk / 26101795586

19 May 2026 01:53PM UTC coverage: 80.132% (+1.9%) from 78.235%
26101795586

push

github

web-flow
feat(api-kit): add HttpError class with statusCode and improve sendRequest (#1340)

- Add HttpError extends Error with statusCode and data properties,
  exported from the public API so callers can detect specific HTTP
  errors (e.g. 429 rate limits) via instanceof checks
- Refactor sendRequest to use response.text() instead of response.json(),
  making the empty-body path (204/201 no-content) explicit and surfacing
  malformed 2xx responses as a SyntaxError instead of silently returning
  undefined
- Fix sendRequest stub in index.test.ts being declared at module scope,
  which infected all test files during mocha's loading phase; moved into
  before/after hooks with sinon.restore()
- Add unit tests for sendRequest covering all response paths

267 of 409 branches covered (65.28%)

Branch coverage included in aggregate %.

24 of 29 new or added lines in 2 files covered. (82.76%)

947 of 1106 relevant lines covered (85.62%)

4.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.36
/packages/api-kit/src/utils/httpRequests.ts


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc