OneDrive Error Code Handling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; | |
namespace Microsoft.OneDrive | |
{ | |
public class OneDriveError | |
{ | |
[JsonProperty("error")] | |
public OneDriveInnerError Error { get; set; } | |
public static OneDriveError FromJson(string json) | |
{ | |
return JsonConvert.DeserializeObject<OneDriveError>(json); | |
} | |
public bool IsError(string expectedErrorCode) | |
{ | |
OneDriveInnerError errorCode = this.Error; | |
while (null != errorCode) | |
{ | |
if (errorCode.Code == expectedErrorCode) | |
return true; | |
errorCode = errorCode.InnerError; | |
} | |
return false; | |
} | |
} | |
public class OneDriveInnerError | |
{ | |
[JsonProperty("code")] | |
public string Code { get; set; } | |
[JsonProperty("message")] | |
public string Message { get; set; } | |
[JsonProperty("innererror")] | |
public OneDriveInnerError InnerError { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello Microsoft why to much error code can't you fix it? is be long time sence is problem started??????