Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
deeleeramone committed Dec 18, 2024
1 parent 88978b3 commit 78a4969
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 78a4969

Please sign in to comment.