Skip to content

Commit

Permalink
standarize functions when undefined error code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarek-Rolski committed Feb 9, 2024
1 parent a2bc0b4 commit 5470dcb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions sdk/rapid/rapid.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ def create_user(self, user_name: str, user_email: str, user_permissions: list[st
raise ClientDoesNotHaveUserAdminPermissionsException(
data["details"]
)
else:
raise Exception(data["details"])

raise Exception("Failed to create user")

def delete_user(self, user_name: str, user_id: str):
"""
Expand Down Expand Up @@ -514,8 +514,8 @@ def delete_user(self, user_name: str, user_id: str):
raise ClientDoesNotHaveUserAdminPermissionsException(
data["details"]
)
else:
raise Exception(data["details"])

raise Exception("Failed to delete user")

def list_subjects(self):
"""
Expand All @@ -536,8 +536,8 @@ def list_subjects(self):
raise ClientDoesNotHaveUserAdminPermissionsException(
data["details"]
)
else:
raise Exception(data["details"])

raise Exception("Failed to list subjects")

def list_layers(self):
"""
Expand All @@ -554,8 +554,8 @@ def list_layers(self):
data = json.loads(response.content.decode("utf-8"))
if response.status_code == 200:
return data
else:
raise Exception(data["details"])

raise Exception("Failed to list layers")

def list_protected_domains(self):
"""
Expand All @@ -576,8 +576,8 @@ def list_protected_domains(self):
raise ClientDoesNotHaveUserAdminPermissionsException(
data["details"]
)
else:
raise Exception(data["details"])

raise Exception("Failed to list protected domains")

def delete_dataset(self, layer: str, domain: str, dataset: str):
"""
Expand Down Expand Up @@ -608,5 +608,5 @@ def delete_dataset(self, layer: str, domain: str, dataset: str):
raise ClientDoesNotHaveDataAdminPermissionsException(
data["details"]
)
else:
raise Exception(data["details"])

raise Exception("Failed to delete dataset")

0 comments on commit 5470dcb

Please sign in to comment.