egnyte / egnyte-dotnet

.NET SDK for the Egnyte Public API
5 stars 17 forks source link

Update FilesClient.cs #5

Closed GarethWright closed 6 years ago

GarethWright commented 6 years ago

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.

GarethWright commented 6 years ago

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.