Rethrowing Web Exception
Kyle Chafin
Branch: feature/GetResponseWithoutException-Issue
Branch: develop
Merged
Merged pull request
Merged in feature/GetResponseWithoutException-Issue (pull request #15)
Merged in feature/GetResponseWithoutException-Issue (pull request #15)
WebException::Response can be null according to the MSDN documentation. (https://msdn.microsoft.com/en-us/library/system.net.webexception.response(v=vs.110).aspx)
When the SDK uses the GetResponsewithoutException extension method, it is not expecting a null value to be returned. In all cases, it immediately calls the StatusCode property on the returned value. This causes a Null Reference exception, which masks the more helpful details of the original WebException.
This change rethrows the WebException if no Response is provided.