Пример #1
0
 internal static void TraceInvocationResult <T>(long sessionId, MessageType messageType, int messageId, string operationId, RpcErrorMessage error, T result)
 {
     if (error.IsSuccess)
     {
         if (MsgPackRpcServerDispatchTrace.ShouldTrace(MsgPackRpcServerDispatchTrace.OperationSucceeded))
         {
             MsgPackRpcServerDispatchTrace.TraceEvent(
                 MsgPackRpcServerDispatchTrace.OperationSucceeded,
                 "Operation succeeded. {{ \"SessionId\" : {0}, \"MessageType\" : \"{1}\", \"MessageID\" : {2}, \"OperationID\" : \"{3}\", \"Result\" : \"{4}\" }}",
                 sessionId,
                 messageType,
                 messageId,
                 operationId,
                 result
                 );
         }
     }
     else
     {
         MsgPackRpcServerDispatchTrace.TraceEvent(
             MsgPackRpcServerDispatchTrace.OperationFailed,
             "Operation failed. {{ \"SessionId\" : {0}, \"MessageType\" : \"{1}\", \"MessageID\" : {2}, \"OperationID\" : \"{3}\", \"RpcError\" : {4} }}",
             sessionId,
             messageType,
             messageId,
             operationId,
             error
             );
     }
 }
Пример #2
0
        public static RpcErrorMessage HandleInvocationException(long sessionId, MessageType messageType, int?messageId, string operationId, Exception exception, bool isDebugMode)
        {
            MsgPackRpcServerDispatchTrace.TraceEvent(
                MsgPackRpcServerDispatchTrace.OperationThrewException,
                "Operation threw exception. {{ \"SessionId\" : {0}, \"MessageType\" : \"{1}\", \"MessageID\" : {2}, \"OperationID\" : \"{3}\", \"Exception\" : \"{4}\" }}",
                sessionId,
                messageType,
                messageId,
                operationId,
                exception
                );

            return(HandleInvocationException(exception, operationId, isDebugMode));
        }