public Error(int?requestId, CodeMsgPair error, string tail)
 {
     RequestId    = requestId;
     ErrorCode    = error.Code;
     ErrorMessage = error.Message + tail;
     Exception    = null;
 }
示例#2
0
 public void Send(int reqId, List <byte> paramsList, CodeMsgPair error)
 {
     try
     {
         Send(paramsList);
     }
     catch (Exception e)
     {
         throw new Exception(String.Format("Exception. Id: {0}, Code: {1}, Msg: {2}", reqId, error.Code, error.Message), e);
     }
 }
示例#3
0
        public void SendCancelRequest(OutgoingMessages msgType, int version, CodeMsgPair error)
        {
            List <byte> paramsList = new List <byte>();

            paramsList.AddParameter(msgType);
            paramsList.AddParameter(version);
            try
            {
                Send(paramsList);
            }
            catch (Exception e)
            {
                throw new Exception(String.Format("Exception. Code: {0}, Msg: {1}", error.Code, error.Message), e);
            }
        }
 protected void SendCancelRequest(int msgType, int version, CodeMsgPair errorMessage)
 {
     List<byte> paramsList = new List<byte>();
     paramsList.AddParameter(msgType);
     paramsList.AddParameter(version);
     try
     {
         lock (this)
         {
             Send(paramsList);
         }
     }
     catch (Exception)
     {
         wrapper.error(IncomingMessage.NotValid, errorMessage.Code, errorMessage.Message);
         Close();
     }
 }
 protected void ReportError(int reqId, CodeMsgPair error, string tail)
 {
     ReportError(reqId, error.Code, error.Message+tail);
 }
 protected void Send(int reqId, List<byte> paramsList, CodeMsgPair error)
 {
     try
     {
         lock (this)
         {
             Send(paramsList);
         }
     }
     catch (Exception)
     {
         wrapper.error(reqId, error.Code, error.Message);
         Close();
     }
 }
 protected void Send(List<byte> paramsList, CodeMsgPair error)
 {
     Send(IncomingMessage.NotValid, paramsList, error);
 }
示例#8
0
 public EClientException(CodeMsgPair err, string text) : this(err)
 {
     Text = text;
 }
示例#9
0
 public EClientException(CodeMsgPair err)
 {
     Err = err;
 }
示例#10
0
 public void Send(List <byte> paramsList, CodeMsgPair error)
 {
     Send(IncomingMessage.NotValid, paramsList, error);
 }
示例#11
0
        protected void SendCancelRequest(OutgoingMessages msgType, int version, CodeMsgPair errorMessage)
        {
            var paramsList = new BinaryWriter(new MemoryStream());
            var lengthPos = prepareBuffer(paramsList);

            paramsList.AddParameter(msgType);
            paramsList.AddParameter(version);
            try
            {
                lock (this)
                {
                    CloseAndSend(paramsList, lengthPos);
                }
            }
            catch (Exception)
            {
                wrapper.error(IncomingMessage.NotValid, errorMessage.Code, errorMessage.Message);
                Close();
            }
        }
示例#12
0
 protected void CloseAndSend(int reqId, BinaryWriter paramsList, uint lengthPos, CodeMsgPair error)
 {
     try
     {
         lock (this)
         {
             CloseAndSend(paramsList, lengthPos);
         }
     }
     catch (Exception)
     {
         wrapper.error(reqId, error.Code, error.Message);
         Close();
     }
 }
示例#13
0
 protected void CloseAndSend(BinaryWriter paramsList, uint lengthPos, CodeMsgPair error)
 {
     CloseAndSend(IncomingMessage.NotValid, paramsList, lengthPos, error);
 }
示例#14
0
 public EClientException(CodeMsgPair err)
 {
     this.Err = err;
 }
示例#15
0
 public Error(int? requestId, CodeMsgPair error, string tail)
 {
     RequestId = requestId;
     ErrorCode = error.Code;
     ErrorMessage = error.Message + tail;
     Exception = null;
 }