diff --git a/aiobastion/safe.py b/aiobastion/safe.py index 987b2e9..17c52b1 100644 --- a/aiobastion/safe.py +++ b/aiobastion/safe.py @@ -259,8 +259,11 @@ async def list_members(self, safe_name: str, filter_perm=None, details=False, ra #url = f"WebServices/PIMServices.svc/Safes/{safe_name}/Members" url = f"api/Safes/{safe_name}/Members" - members = await self.epv.handle_request("get", url, filter_func=lambda x: x["value"]) - + try: + members = await self.epv.handle_request("get", url, filter_func=lambda x: x["value"]) + except CyberarkException as err: + raise CyberarkAPIException(404, "ERR_404", f"Safe {safe_name} doesn't exist") + if raw: return members