huin / goupnp

UPnP client library for Go (#golang)
BSD 2-Clause "Simplified" License
424 stars 85 forks source link

Improve error handling #38

Closed dennwc closed 3 years ago

dennwc commented 3 years ago

Currently the SOAP client returns opaque fmt.Errorf when the server responds with non-OK status. This PR changes the code to always parse the response body, as long as it's not empty.

It also fixes the SOAP Fault type to properly decode fields and allow to further assert the error details.

huin commented 3 years ago

Thanks, looks good.