Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Refactor http-client #111

Closed
mistermoe opened this issue Dec 5, 2023 · 2 comments
Closed

Refactor http-client #111

mistermoe opened this issue Dec 5, 2023 · 2 comments
Assignees

Comments

@mistermoe
Copy link
Member

Currently http-client methods returns DataResponse or ErrorResponse, both of which are HttpResponses. The Developer Experience is a bit awkward because

  1. returning status and headers doesn't really provide any benefit
  2. it's not entirely evident how callers should figure out whether the response received includes an error

We may want to consider something a bit more high level that:

  1. drops inclusion of headers and status in what's returned
  2. throw errors instead of returning them

for example, getOfferings would just return Offering[] on success or throw an error otherwise.

@kirahsapong
Copy link
Contributor

Introduced msw for mocking requests in http-client tests in #113. Currently only configured for node, will need to configure for browser tests in a followup PR.

@kirahsapong
Copy link
Contributor

Closed by #113

@github-project-automation github-project-automation bot moved this from In Progress to Done in SDK Development Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants