diff --git a/openbb_platform/core/openbb_core/provider/utils/websockets/client.py b/openbb_platform/core/openbb_core/provider/utils/websockets/client.py index 35accd184b9..1fecc2096eb 100644 --- a/openbb_platform/core/openbb_core/provider/utils/websockets/client.py +++ b/openbb_platform/core/openbb_core/provider/utils/websockets/client.py @@ -181,7 +181,7 @@ def __init__( # noqa: PLR0913 # pylint: disable=too-many-arguments,too-many-po except Exception as e: # pylint: disable=broad-except msg = ( "Unexpected error setting up the SQLite database and table ->" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__} -> {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) self._exception = OpenBBError(msg) @@ -570,7 +570,7 @@ def results(self): except Exception as e: # pylint: disable=broad-except msg = ( "Error clearing results:" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__} -> {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) @@ -800,7 +800,7 @@ def non_blocking_websocket(client, output_queue, provider_message_queue) -> None except Exception as e: # pylint: disable=broad-except msg = ( "Unexpected error in non_blocking_websocket:" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__} -> {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) client.logger.error(msg) raise e from e @@ -834,7 +834,7 @@ def send_message( except Exception as e: # pylint: disable=broad-except msg = ( f"Error sending message to the {target} process:" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__} -> {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) client.logger.error(msg) @@ -877,7 +877,7 @@ def non_blocking_broadcast(client, output_queue, broadcast_message_queue) -> Non except Exception as e: # pylint: disable=broad-except err = ( f"Unexpected error in non_blocking_broadcast:" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__} -> {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) client.logger.error(err) finally: diff --git a/openbb_platform/core/openbb_core/provider/utils/websockets/database.py b/openbb_platform/core/openbb_core/provider/utils/websockets/database.py index 19968f88e68..4f3552218c3 100644 --- a/openbb_platform/core/openbb_core/provider/utils/websockets/database.py +++ b/openbb_platform/core/openbb_core/provider/utils/websockets/database.py @@ -88,7 +88,7 @@ def __init__( self.results_file = temp_file_path elif results_file and "://" in results_file: self.results_file = results_file - self.results_path = results_file + self.results_path = results_file # type: ignore kwargs["uri"] = True else: self.results_path = Path(results_file).absolute() @@ -144,10 +144,10 @@ async def _setup_database(self): except Exception as e: msg = ( "Unexpected error while creating SQLite database ->" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__}: {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) - self._exception = e + self._exception = e # type: ignore raise OpenBBError(msg) from e async def _write_to_db(self, message) -> None: @@ -224,7 +224,7 @@ def write_to_db(self, message) -> None: except Exception as e: # pylint: disable=broad-except msg = ( "Unexpected error while writing to SQLite database ->" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__}: {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) self._exception = e @@ -278,10 +278,10 @@ def deserialize_row(self, row: str) -> Union["BaseModel", Any]: except Exception as e: msg = ( "Unexpected error while deserializing row -> " - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__}: {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) - self._exception = e + self._exception = e # type: ignore raise OpenBBError(msg) from e def fetch_all(self, limit: Optional[int] = None) -> list: @@ -291,7 +291,7 @@ def fetch_all(self, limit: Optional[int] = None) -> list: except Exception as e: msg = ( "Unexpected error while reading from SQLite database ->" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__}: {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) self._exception = e @@ -414,7 +414,7 @@ def clear_results(self) -> None: except Exception as e: # pylint: disable=broad-except msg = ( "Error clearing results: " - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__}: {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) raise OpenBBError(msg) from e