Skip to content

Commit

Permalink
fix: added exception to user class
Browse files Browse the repository at this point in the history
  • Loading branch information
MalikAza committed Aug 5, 2024
1 parent 33f9670 commit f902f1d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyZUnivers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ class User:

def __init__(self, username : str) -> None:
self.name, self.__parsed_name = parse_username(username)
self.__base_infos: Base = get_datas(f"{API_BASE_URL}/user/{self.__parsed_name}")
try:
self.__base_infos: Base = get_datas(f"{API_BASE_URL}/user/{self.__parsed_name}")
except ResourceNotFoundError:
raise UserNotFound(self.name)
self.__user = self.__base_infos['user']
self.__leaderboards = self.__base_infos['leaderboards']

Expand Down

0 comments on commit f902f1d

Please sign in to comment.