bat-go icon indicating copy to clipboard operation
bat-go copied to clipboard

Improve Error Management of the Client HTTP Implementation

Open Sneagan opened this issue 11 months ago • 1 comments

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

Sneagan avatar Mar 21 '24 17:03 Sneagan

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.

Sneagan avatar Apr 19 '24 02:04 Sneagan