ShipEngine / shipengine-dotnet

The official ShipEngine SDK for C# and the .NET Framework
https://www.shipengine.com/docs/
Apache License 2.0
11 stars 11 forks source link

Handle unexpected HTTP responses #94

Closed joshuaflanagan closed 4 months ago

joshuaflanagan commented 4 months ago

This will better handle the situation where the HTTP response body cannot be parsed as JSON. Instead of throwing a JsonException, we will throw a ShipEngineException containing the HttpResponseMessage. This will give the caller a chance to handle the response in their own way.

We will also try to include a request ID on all ShipeEngineException now - by pulling from the response header in cases where we don't get a ShipEngine Error JSON response.

coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 9717752223

Details


Totals Coverage Status
Change from base Build 9714075367: 0.9%
Covered Lines: 654
Relevant Lines: 816

💛 - Coveralls
coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 9718240694

Details


Totals Coverage Status
Change from base Build 9714075367: 1.3%
Covered Lines: 654
Relevant Lines: 813

💛 - Coveralls
coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 9718822717

Details


Totals Coverage Status
Change from base Build 9714075367: 2.3%
Covered Lines: 657
Relevant Lines: 814

💛 - Coveralls