예제 #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;
 }
예제 #2
0
        internal CommunicationErrorResponse(CommunicationError error)
        {
            if (error == null)
            {
                throw new ArgumentNullException(nameof(error));
            }

            Error = error;
        }
예제 #3
0
        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));
        }