Skip to content

Commit 8716eec

Browse files
authored
Merge pull request #224 from MerginMaps/cleanup-client-service
Cleanup: Remove deprecated function and improve error handling
2 parents 70c48a9 + 2d521a1 commit 8716eec

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

mergin/client.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -336,41 +336,15 @@ def username(self):
336336
return None # not authenticated
337337
return self._user_info["username"]
338338

339-
def user_service(self):
340-
"""
341-
Requests information about user from /user/service endpoint if such exists in self.url server.
342-
343-
Returns response from server as JSON dict or None if endpoint is not found
344-
This can be removed once our SaaS server is upgraded to support workspaces
345-
"""
346-
347-
try:
348-
response = self.get("/v1/user/service")
349-
except ClientError as e:
350-
self.log.debug("Unable to query for /user/service endpoint")
351-
return
352-
353-
response = json.loads(response.read())
354-
355-
return response
356-
357339
def workspace_service(self, workspace_id):
358340
"""
359341
This Requests information about a workspace service from /workspace/{id}/service endpoint,
360342
if such exists in self.url server.
361343
362344
Returns response from server as JSON dict or None if endpoint is not found
363345
"""
364-
365-
try:
366-
response = self.get(f"/v1/workspace/{workspace_id}/service")
367-
except ClientError as e:
368-
self.log.debug(f"Unable to query for /workspace/{workspace_id}/service endpoint")
369-
return
370-
371-
response = json.loads(response.read())
372-
373-
return response
346+
resp = self.get(f"/v1/workspace/{workspace_id}/service")
347+
return json.loads(resp)
374348

375349
def workspace_usage(self, workspace_id):
376350
"""

0 commit comments

Comments
 (0)