OneDrive / onedrive-sdk-csharp

OneDrive SDK for C#! https://dev.onedrive.com
Other
294 stars 143 forks source link

Incorrect exception when service is down #190

Closed elegault closed 7 years ago

elegault commented 7 years ago

I was just working on my app when suddenly I started getting exceptions for many GetAsync() calls that were working perfectly fine earlier. The I noticed a message on the OneDrive web page: "OneDrive is read-only right now while we do some maintenance. We apologize for the inconvenience".

The error is: "Code: unauthenticatedMessage: The caller is not authenticated." (HResult = -2146233088)

Perhaps error messages specific to service availability would be more appropriate?

(EDIT: I realized after I posted this that I wasn't checking ServiceException for a match on OneDriveErrorCode.ServiceNotAvailable, so perhaps this is already handled. My apologies if it is)

cdmayer commented 7 years ago

It does sound like this is an issue where the service was returning the wrong error code, but that wouldn't be an issue with the SDK. Next time you see something like this, even if it seems intermittent, can you post it on the API Docs repo? Thanks!