raise exc as OpenBBError in client.connect

This commit is contained in:
Danglewood
2024-11-11 16:59:57 -08:00
parent 6b640df493
commit 8712e0569f
2 changed files with 9 additions and 3 deletions

View File

@@ -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.")

View File

@@ -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.",
)