DownloadFile method did not throw an exception, instead it just downloaded an unexpected file with api error message as content so calling method assumes a success on downloaded file.
Modified to throw an exception based on existence of X-Mashery-Error-Code response header.
Probably a better way to do this but it works for us.
Actually found a much better way by implementing a Retry Policy using Polly.
More extensive changes required but everything is handled in the SDK.
Closing this pull request.
DownloadFile method did not throw an exception, instead it just downloaded an unexpected file with api error message as content so calling method assumes a success on downloaded file. Modified to throw an exception based on existence of X-Mashery-Error-Code response header.
Probably a better way to do this but it works for us.