コード例 #1
0
        private Exception ReadException()
        {
            switch (ReplyStatus)
            {
            case ReplyStatus.UserException:
            {
                return(InputStream.ReadEncapsulation(_communicator, Payload.Slice(1), istr => istr.ReadException()));
            }

            case ReplyStatus.ObjectNotExistException:
            case ReplyStatus.FacetNotExistException:
            case ReplyStatus.OperationNotExistException:
            {
                return(ReadDispatchException());
            }

            default:
            {
                Debug.Assert(ReplyStatus == ReplyStatus.UnknownException ||
                             ReplyStatus == ReplyStatus.UnknownLocalException ||
                             ReplyStatus == ReplyStatus.UnknownUserException);
                return(ReadUnhandledException());
            }
            }
        }
コード例 #2
0
 /// <summary>Reads the return value carried by this response frame. If the response frame carries
 /// a failure, reads and throws this exception.</summary>
 /// <param name="reader">An input stream reader used to read the frame return value, when the frame
 /// return value contain multiple values the reader must use a tuple to return the values.</param>
 /// <returns>The frame return value.</returns>
 public T ReadReturnValue <T>(InputStreamReader <T> reader)
 {
     if (ReplyStatus == ReplyStatus.OK)
     {
         return(InputStream.ReadEncapsulation(_communicator, Payload.Slice(1), reader));
     }
     else
     {
         throw ReadException();
     }
 }
コード例 #3
0
 /// <summary>Reads the request frame parameter list.</summary>
 /// <param name="reader">An InputStreamReader delegate used to read the request frame
 /// parameters.</param>
 /// <returns>The request parameters, when the frame parameter list contains multiple parameters
 /// they must be return as a tuple.</returns>
 public T ReadParamList <T>(InputStreamReader <T> reader) =>
 InputStream.ReadEncapsulation(_communicator, Payload, reader);