Example #1
0
        public void error(int id, int errorCode, string errorMsg)
        {
            if (id == -1 && Array.IndexOf(TwsRtdServerErrors.TwsServerErrors(), errorCode) >= 0)
            {
                m_connection.SetError(TwsRtdServerErrors.CANNOT_CONNECT_TO_TWS, errorMsg);
            }

            if (id != -1 && Array.IndexOf(TwsRtdServerErrors.TwsTickerErrors(), errorCode) >= 0)
            {
                TwsRtdServerMktDataRequest mktDataRequest = m_connection.GetMktDataRequest(id);
                if (mktDataRequest != null)
                {
                    mktDataRequest.SetError(errorCode, errorMsg);
                }

                switch (errorCode)
                {
                case 10167:
                {
                    SetAllLiveTopicsValues(id, "TwsRtdServer error: " + errorMsg);
                    break;
                }

                default:
                {
                    SetAllTopicsValues(id, "TwsRtdServer error: " + errorMsg);
                    break;
                }
                }
            }
        }
Example #2
0
 public void SetError(int code)
 {
     m_error = new Tuple <int, string>(code, TwsRtdServerErrors.GetErrorText(code));
 }