bat-go
bat-go copied to clipboard
Improve Error Management of the Client HTTP Implementation
would it not make more sense to handle all the code mapping here so that we may cleanly map to an enum of statuses and only return error if the http request fails?
https://github.com/brave-intl/bat-go/pull/2428/files#r1532560289
Wrap the errors that come out of client.Do()
here so that we can handle the various statuses separately. You should be able to assert into the RestErrData
type returned and then switch off the ResponseHeaders
there.
Do not change the interface of client.Do
as part of this change.