Skip to content

Commit

Permalink
[Mod] 添加解析出错输出信息
Browse files Browse the repository at this point in the history
  • Loading branch information
vnpy committed Aug 2, 2022
1 parent 6095115 commit 8d76ac5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vnpy_tap/gateway/tap_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,12 @@ def send_order(self, req: OrderRequest) -> str:
}

error_id, session, byte_id = self.insertOrder(order_req) # byte_id是bytes类型数据
order_id = byte_id.decode()

try:
order_id = byte_id.decode()
except UnicodeDecodeError:
print("TAP接口返回的本地委托号字符串解析出错:", byte_id)
raise

if self.client_id in order_id:
order_id = order_id.replace(f"#{self.client_id}#", "")
Expand Down

0 comments on commit 8d76ac5

Please sign in to comment.