From bc347a6f136e2f575ec1fc6088b2181552a27be3 Mon Sep 17 00:00:00 2001 From: Ruslan Bel'kov Date: Sat, 28 Sep 2024 21:31:43 +0300 Subject: [PATCH] chore: raise for status --- src/bot/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bot/api.py b/src/bot/api.py index b3251cf..dd1c5ce 100644 --- a/src/bot/api.py +++ b/src/bot/api.py @@ -44,7 +44,7 @@ async def start_registration(self, telegram_id: int) -> tuple[bool | None, Any]: return False, "A user with the provided telegram is already registered." if response.status_code == 200: return True, "A user has been successfully registered." - raise RuntimeError("Unexpected response status") + response.raise_for_status() async def is_user_exists(self, telegram_id: int) -> bool: params = {"telegram_id": telegram_id}