From b33ffa444f357ef8276dd1a43e5f715b27954ac8 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Mon, 23 Dec 2024 15:04:50 +0800 Subject: [PATCH] fix: handle broader request exceptions in OAuth process Signed-off-by: -LAN- --- api/controllers/console/auth/oauth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/controllers/console/auth/oauth.py b/api/controllers/console/auth/oauth.py index 5de8c6766d35a8..b9188aa0798ea2 100644 --- a/api/controllers/console/auth/oauth.py +++ b/api/controllers/console/auth/oauth.py @@ -76,7 +76,7 @@ def get(self, provider: str): try: token = oauth_provider.get_access_token(code) user_info = oauth_provider.get_user_info(token) - except requests.exceptions.HTTPError as e: + except requests.exceptions.RequestException as e: logging.exception(f"An error occurred during the OAuth process with {provider}: {e.response.text}") return {"error": "OAuth process failed"}, 400