Example #1
0
		/// <summary>
		/// Creating the server error might fail in cases where a proxy returns an http response which is not json at all
		/// </summary>
		public static bool TryCreate(Stream stream, out ServerError serverError)
		{
			serverError = null;
			try { serverError = Create(stream); }
			catch { return false; }
			return true;
		}
Example #2
0
 public override object DeserializeObject(object value, Type type)
 {
     if (type == typeof(DynamicResponse))
     {
         var dict = base.DeserializeObject(value, typeof(Dictionary <string, object>)) as IDictionary <string, object>;
         return(dict == null ? null : DynamicResponse.Create(dict));
     }
     if (type == typeof(ServerError))
     {
         var dict = base.DeserializeObject(value, typeof(Dictionary <string, object>)) as IDictionary <string, object>;
         return(ServerError.Create(dict, this));
     }
     if (type == typeof(Error))
     {
         var dict = base.DeserializeObject(value, typeof(Dictionary <string, object>)) as IDictionary <string, object>;
         return(Error.Create(dict, this));
     }
     if (type == typeof(RootCause))
     {
         var dict = base.DeserializeObject(value, typeof(Dictionary <string, object>)) as IDictionary <string, object>;
         return(RootCause.Create(dict, this));
     }
     return(base.DeserializeObject(value, type));
 }
		public ApiCallDetailsOverride(IApiCallDetails original, ServerError error)
		{
			_original = original;
			_error = error;
			_isValid = false;
		}