Skip to content

Commit

Permalink
ClientError already handled by self.get
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinBuira committed Dec 3, 2024
1 parent f018a50 commit dcbeb22
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions mergin/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,8 @@ def workspace_usage(self, workspace_id):
Returns response from server as JSON dict or None if endpoint is not found
"""

try:
response = self.get(f"/v1/workspace/{workspace_id}/usage")
except ClientError as e:
e.extra = f"Unable to query for /workspace/{workspace_id}/usage endpoint"
raise e

response = json.loads(response.read())

return response
resp = self.get(f"/v1/workspace/{workspace_id}/usage")
return json.load(resp)

def server_type(self):
"""
Expand Down

0 comments on commit dcbeb22

Please sign in to comment.