mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 12:30:50 +01:00
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:
parent
45f35ef099
commit
5529626ac5
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
xc-local-release/dotnet-packages/master/18
|
||||
xc-local-release/dotnet-packages/master/20
|
||||
|
Loading…
Reference in New Issue
Block a user