コード例 #1
0
        OperationResponse IOperationHandler.OnOperationRequest(PeerBase peer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            try
            {
                return(this.OnOperationRequest(peer, operationRequest, sendParameters));
            }
            catch (Exception e)
            {
                /// we do not use LogExtensions log methods here to reduce cpu loading if message will be skipped anyway
                if (exceptionLogGuard.IncrementAndCheck())
                {
                    var message = LogExtensions.AddSkipedMessagesInfo(exceptionLogGuard,
                                                                      $"OnOperationRequest Exception: p:{peer}, Exception Msg:{e.Message}, request:{ValueToString.OperationToString(operationRequest)}");
                    log.Error(message, e);
                }

                return(new OperationResponse(operationRequest.OperationCode)
                {
                    ReturnCode = (short)ErrorCode.InternalServerError,
                    DebugMessage = e.ToString()
                });
            }
        }