docs: document Tencent quote refresh

This commit is contained in:
王鹏
2026-07-08 22:06:39 +08:00
parent 93e548d8a7
commit f7ef52ef64
3 changed files with 28 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ from __future__ import annotations
import re
from decimal import Decimal, InvalidOperation
from typing import Callable, Iterable
from urllib.error import HTTPError, URLError
from urllib.request import urlopen
from grid_trading.domain.models import Instrument, QuoteSnapshot
@@ -61,7 +62,10 @@ class TencentQuoteProvider:
return {}
query = ",".join(symbols)
url = f"{self.endpoint}{query}"
raw = self._fetcher(url, self.timeout)
try:
raw = self._fetcher(url, self.timeout)
except (OSError, HTTPError, URLError) as exc:
raise QuoteFetchError(f"Tencent quote request failed: {exc}") from exc
return {quote.code: quote for quote in parse_tencent_response(raw)}