restJson error deserialization fails on empty body #4811
Labels
bug
This issue is a bug.
pending-release
This issue will be fixed by an approved PR that hasn't been released yet.
Describe the bug
Uncovered by #4740.
In scenarios where restjson error deserialization falls back to inspect the body, the SDK has always failed if the body is empty.
Before the above change, this code path would have only been hit when the error response did NOT contain the code as a header. Post-change, it is now hit when the headers are also missing the message.
We should consider this error message purely optional, the only value needed to deserialize to the appropriate type is the code.
Expected Behavior
deserialized error
Current Behavior
unmarshal error
Reproduction Steps
n/a
Possible Solution
No response
Additional Information/Context
No response
SDK version used
latest
Environment details (Version of Go (
go version
)? OS name and version, etc.)n/a
The text was updated successfully, but these errors were encountered: