Open ahmedsafadii opened 4 months ago
How i can catch the exceptions for example if the summoner is not found and I want to catch it so I can return a custom message.
def test():
lol_manager = LolManager() puuid = "ovqw2cGBNvqhlGZV3u1lBWmROrfXVTnjjAfoOd5GN-e_YeTGnVossVzw84Z_GDHpvgDC_fVJ3FQACg1" server = "EUW" try: summoner = lol_manager.get_summoner_by_puuid(puuid=puuid, region=server) print("Summoner found:", summoner.account_id) except HTTPError as e: print("HTTP error:", e) except Exception as e: print("An unexpected error occurred:", e)
my settings
settings = { "RiotAPI": { "api_key": RIOT_API_KEY, "request_error_handling": { "404": {"strategy": "throw"}, "429": { "service": { "strategy": "exponential_backoff", "initial_backoff": 1.0, "backoff_factor": 2.0, "max_attempts": 4, }, "method": {"strategy": "retry_from_headers", "max_attempts": 5}, "application": { "strategy": "retry_from_headers", "max_attempts": 5, }, }, "500": { "strategy": "exponential_backoff", "initial_backoff": 1.0, "backoff_factor": 2.0, "max_attempts": 4, }, "503": { "strategy": "exponential_backoff", "initial_backoff": 1.0, "backoff_factor": 2.0, "max_attempts": 8, }, "timeout": {"strategy": "throw"}, "403": {"strategy": "throw"}, "504": { "strategy": "exponential_backoff", "initial_backoff": 1.0, "backoff_factor": 2.0, "max_attempts": 4, }, "502": { "strategy": "exponential_backoff", "initial_backoff": 1.0, "backoff_factor": 2.0, "max_attempts": 4, }, }, } }
Hey, can you assign me this issue please !
How i can catch the exceptions for example if the summoner is not found and I want to catch it so I can return a custom message.
def test():
my settings