CA-284234: Used patched version of Json.NET.

Also, fixed deserialization for errors on servers using JsonRpc v1.0.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2018-02-27 16:35:27 +00:00 committed by Mihaela Stoica
parent 45f35ef099
commit 5529626ac5
2 changed files with 7 additions and 3 deletions

View File

@ -126,7 +126,7 @@ namespace XenAPI
internal class JsonResponseV1<T> : JsonResponse<T>
{
[JsonProperty("error", Required = Required.AllowNull)] public object Error = null;
[JsonProperty("error", Required = Required.AllowNull)] public JToken Error = null;
}
internal class JsonResponseV2<T> : JsonResponse<T>
@ -267,7 +267,11 @@ namespace XenAPI
var res1 = (JsonResponseV1<T>)serializer.Deserialize(responseReader, typeof(JsonResponseV1<T>));
#endif
if (res1.Error != null)
throw new Failure(res1.Error as string[]);
{
var errorArray = res1.Error.ToObject<string[]>();
if (errorArray != null)
throw new Failure(errorArray);
}
return res1.Result;
}
}

View File

@ -1 +1 @@
xc-local-release/dotnet-packages/master/18
xc-local-release/dotnet-packages/master/20