public JObject Serialize(ApiError error) { var result = new JObject(); var json = JObject.FromObject(error, new JsonSerializer { NullValueHandling = NullValueHandling.Ignore }); foreach (var token in json) { result.Add(token.Key.ToCamelCase(), token.Value); } return new JObject { ["errors"] = new JArray { result } }; }
public static bool IsClientError(ApiError error) { return(error._exception != null && error._exception.ErrorType == ErrorType.Client); }
public static bool IsClientError(ApiError error) { return error._exception != null && error._exception.ErrorType == ErrorType.Client; }