From 01e08aae67673dd6110c8524f5082ea2f6b3e7c7 Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:36:22 -0800 Subject: [PATCH] missing doctstring --- .../intrinio/openbb_intrinio/utils/stocks_client.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/utils/stocks_client.py b/openbb_platform/providers/intrinio/openbb_intrinio/utils/stocks_client.py index 76e3dc2a7ef..ed2e6803c2a 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/utils/stocks_client.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/utils/stocks_client.py @@ -100,6 +100,7 @@ class Quote: ) def to_json(self): + """Return the quote as a JSON string.""" return json.dumps( dict( symbol=self.symbol, @@ -167,6 +168,7 @@ class Trade: ) def to_json(self): + """Return the trade as a JSON string.""" return json.dumps( dict( symbol=self.symbol, @@ -341,7 +343,7 @@ class IntrinioRealtimeClient: self.refresh_websocket() connected = True except Exception as e: - self.logger.error(f"Cannot connect: {repr(e)}") + self.logger.error(f"Unexpected error while connecting -> {repr(e)}") self.do_backoff() def disconnect(self): @@ -367,7 +369,9 @@ class IntrinioRealtimeClient: ) if response.status_code != 200: - raise UnauthorizedError("Auth failed") + raise UnauthorizedError( + f"""Connection failed with status code {response.status_code} and message "{response.reason}".""" + ) self.token = response.text self.logger.info("INFO: Authentication successful!")