Merge pull request #1 from vnpy/dev

update dev 724
This commit is contained in:
LimingFang 2019-07-24 13:02:03 +08:00 committed by GitHub
commit 4e75e145f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import json
import zlib
import hashlib
import hmac
import sys
from copy import copy
from datetime import datetime
from threading import Lock
@ -752,6 +753,19 @@ class HbdmRestApi(RestClient):
if not issubclass(exception_type, ConnectionError):
self.on_error(exception_type, exception_value, tb, request)
def on_error(
self, exception_type: type, exception_value: Exception, tb, request: Request
):
"""
Callback to handler request exception.
"""
msg = f"触发异常,状态码:{exception_type},信息:{exception_value}"
self.gateway.write_log(msg)
sys.stderr.write(
self.exception_detail(exception_type, exception_value, tb, request)
)
def check_error(self, data: dict, func: str = ""):
""""""
if data["status"] != "error":

View File

@ -9,6 +9,7 @@ import json
import zlib
import hashlib
import hmac
import sys
from copy import copy
from datetime import datetime
@ -441,6 +442,19 @@ class HuobiRestApi(RestClient):
self.order_manager.on_order(order)
def on_error(
self, exception_type: type, exception_value: Exception, tb, request: Request
):
"""
Callback to handler request exception.
"""
msg = f"触发异常,状态码:{exception_type},信息:{exception_value}"
self.gateway.write_log(msg)
sys.stderr.write(
self.exception_detail(exception_type, exception_value, tb, request)
)
def check_error(self, data: dict, func: str = ""):
""""""
if data["status"] != "error":

View File

@ -50,7 +50,7 @@ class RpcGateway(BaseGateway):
def send_order(self, req: OrderRequest):
""""""
gateway_name = self.symbol_gateway_map.get(req.vt_symbol, "")
self.client.send_order(req, gateway_name)
return self.client.send_order(req, gateway_name)
def cancel_order(self, req: CancelRequest):
""""""