public void AddItem(string requestString, Action <RequestItem> ProcessResultAction, RequestParams reqparam = null) { RequestItem reqitem = new RequestItem(); reqitem.reqparam = reqparam; reqitem.requestString = requestString; reqitem.ProcessResultAction = ProcessResultAction; items.Add(reqitem); }
public void HandleError(RequestItem request, Exception ex) { request.result.error = "Request:" + request.requestString; request.result.exception = ex; if (ex == null) { request.result.errorLevel = ResultErrorLevel.ERROR; Logman.Log(ex, request.result.error); return; } if (ex.Message == null) { request.result.errorLevel = ResultErrorLevel.ERROR; Logman.Log(ex, request.result.error); return; } if ( ( ex.Message.Contains("422") || ex.Message.Contains("503") || ex.Message.Contains("502") || ex.Message.Contains("500") ) || (ex.Message.Contains("Ddos") && ex.Message.Contains("20-50 mins")) || ex.Message.Contains("DataResult=Null") ) { request.result.errorLevel = ResultErrorLevel.IGNORE; Logman.Log(request.result.error + " -> " + ex.Message); } else { request.result.errorLevel = ResultErrorLevel.ERROR; Logman.Log(ex, request.result.error); } }
public void OrderSellLimit_RequestHandler(RequestItem request) { try { request.result.resultData = market.OrderSellLimitEnd(request.requestString); } catch (Exception ex) { HandleError(request, ex); } }
public void GetTradePairs_RequestHandler(RequestItem request) { try { request.result.resultData = market.GetTradePairsEnd(request.requestString); } catch (Exception ex) { HandleError(request, ex); } }
public void GetOpenOrders_RequestHandler(RequestItem request) { try { request.result.resultData = market.GetOpenOrdersEnd(request.requestString, request.reqparam.ticker); } catch (Exception ex) { HandleError(request, ex); } }
public void GetMarketCurrent_RequestHandler(RequestItem request) { try { request.result.resultData = market.GetMarketCurrentEnd(request.requestString); } catch (Exception ex) { HandleError(request, ex); } }
public void GetPriceHistoryByPeriod_RequestHandler(RequestItem request) { try { request.result.resultData = market.GetPriceHistoryByPeriodEnd(request.requestString); } catch (Exception ex) { HandleError(request, ex); } }
public void HandleError(RequestItem request, Exception ex) { request.result.error = "Request:" + request.requestString; request.result.exception = ex; Helper.logger.Error(ex, request.result.error); }