mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
raise exc as OpenBBError in client.connect
This commit is contained in:
@@ -328,6 +328,7 @@ class WebSocketClient:
|
||||
import subprocess
|
||||
import threading
|
||||
import time
|
||||
from openbb_core.app.model.abstract.error import OpenBBError
|
||||
|
||||
if self.is_running:
|
||||
self.logger.info("Provider connection already running.")
|
||||
@@ -388,7 +389,7 @@ class WebSocketClient:
|
||||
if self._exception is not None:
|
||||
exc = getattr(self, "_exception", None)
|
||||
self._exception = None
|
||||
raise exc
|
||||
raise OpenBBError(exc)
|
||||
|
||||
if not self.is_running:
|
||||
self.logger.error("The provider server failed to start.")
|
||||
|
||||
@@ -650,7 +650,9 @@ class PolygonStockTradeWebSocketData(WebSocketData):
|
||||
"trf_id": "trfi",
|
||||
"tape": "z",
|
||||
"price": "p",
|
||||
"size": "s",
|
||||
"conditions": "c",
|
||||
"trf_timestamp": "trft",
|
||||
}
|
||||
|
||||
type: str = Field(
|
||||
@@ -658,7 +660,7 @@ class PolygonStockTradeWebSocketData(WebSocketData):
|
||||
)
|
||||
date: datetime = Field(
|
||||
description=DATA_DESCRIPTIONS.get("date", "")
|
||||
+ "The end of the aggregate window.",
|
||||
+ "The SIP timestamp of the trade.",
|
||||
)
|
||||
symbol: str = Field(
|
||||
description=DATA_DESCRIPTIONS.get("symbol", ""),
|
||||
@@ -667,6 +669,9 @@ class PolygonStockTradeWebSocketData(WebSocketData):
|
||||
description="The price of the trade.",
|
||||
json_schema_extra={"x-unit_measurement": "currency"},
|
||||
)
|
||||
size: float = Field(
|
||||
description="The size of the trade.",
|
||||
)
|
||||
exchange: str = Field(
|
||||
description="The exchange where the trade originated.",
|
||||
)
|
||||
@@ -677,7 +682,7 @@ class PolygonStockTradeWebSocketData(WebSocketData):
|
||||
default=None,
|
||||
description="The conditions of the trade.",
|
||||
)
|
||||
trf_id: Optional[str] = Field(
|
||||
trf_id: Optional[int] = Field(
|
||||
default=None,
|
||||
description="The ID for the Trade Reporting Facility where the trade took place.",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user