Beispiel #1
0
        internal ErrorResponse(PersonalizerError error)
        {
            if (error == null)
            {
                throw new ArgumentNullException(nameof(error));
            }

            Error = error;
        }
Beispiel #2
0
        internal static ErrorResponse DeserializeErrorResponse(JsonElement element)
        {
            PersonalizerError error = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("error"))
                {
                    error = PersonalizerError.DeserializePersonalizerError(property.Value);
                    continue;
                }
            }
            return(new ErrorResponse(error));
        }