Skip to content

Commit

Permalink
feat: Added an try except block for get_username function
Browse files Browse the repository at this point in the history
  • Loading branch information
onuratakan authored Oct 24, 2024
1 parent 0aaf5f0 commit 5cec4b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion upsonic/remote/on_prem.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,11 @@ def status(self):
return self._send_request(method = "GET",endpoint = "/status")

def get_username(self):
return self._send_request(method = "GET",endpoint = "/my/username")
try:
response = self._send_request(method="GET", endpoint="/my/username")
return response
except Exception as e:
return "to Upsonic"

def get_specific_version(self, package: str) -> int:
package_name = package.split("==")[0]
Expand Down

0 comments on commit 5cec4b1

Please sign in to comment.