Skip to content

Commit

Permalink
fix: update thrown exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeraj319 committed Dec 26, 2024
1 parent d69c6bd commit 64ff02f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 2 additions & 3 deletions python_client/locatr/_locatr.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from locatr.exceptions import (
FailedToRetrieveLocatr,
LocatrInitialHandshakeFailed,
LocatrOutputMessageValidationFailed,
LocatrSocketIsNone,
SocketInitializationError,
)
Expand Down Expand Up @@ -132,8 +131,8 @@ def get_locatr(self, user_req: str):
if not output.status == OutputStatus.OK:
raise FailedToRetrieveLocatr(output.error)
return output.output
except ValidationError as e:
raise LocatrOutputMessageValidationFailed(str(e))
except ValidationError:
raise FailedToRetrieveLocatr("Internal message validation failed.")

async def get_locatr_async(self, user_req: str) -> str:
return await asyncio.to_thread(self.get_locatr, user_req)
Expand Down
5 changes: 0 additions & 5 deletions python_client/locatr/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ def __init__(self, msg) -> None:
super().__init__(msg)


class LocatrOutputMessageValidationFailed(Exception):
def __init__(self, msg: str) -> None:
super().__init__(f"Failed to validate message locatr output: {msg}")


class LocatrSocketError(Exception):
def __init__(self, msg: str) -> None:
super().__init__(msg)
Expand Down

0 comments on commit 64ff02f

Please sign in to comment.