To check for a specific exception inside a catch I would like to do something like this:
catch (ServiceException e) { if (e.Error.Code == OneDriveErrorCode.ItemNotFound.ToString()) { ... } }
But currently, e.Error.Code is "itemNotFound" and OneDriveErrorCode.ItemNotFound.ToString() is "ItemNotFound".
I can workaround this issue with a "ToLower()" but it would be nice to do that comparison based on enums. Or am I missing something?
To check for a specific exception inside a catch I would like to do something like this:
catch (ServiceException e) { if (e.Error.Code == OneDriveErrorCode.ItemNotFound.ToString()) { ... } }
But currently, e.Error.Code is "itemNotFound" and OneDriveErrorCode.ItemNotFound.ToString() is "ItemNotFound". I can workaround this issue with a "ToLower()" but it would be nice to do that comparison based on enums. Or am I missing something?