Example #1
0
 internal CommunicationError(string code, string message, string target, IReadOnlyList <CommunicationError> details, CommunicationError innerError)
 {
     Code       = code;
     Message    = message;
     Target     = target;
     Details    = details;
     InnerError = innerError;
 }
Example #2
0
        internal CommunicationErrorResponse(CommunicationError error)
        {
            if (error == null)
            {
                throw new ArgumentNullException(nameof(error));
            }

            Error = error;
        }
        internal static CommunicationErrorResponse DeserializeCommunicationErrorResponse(JsonElement element)
        {
            CommunicationError error = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("error"))
                {
                    error = CommunicationError.DeserializeCommunicationError(property.Value);
                    continue;
                }
            }
            return(new CommunicationErrorResponse(error));
        }