✏️ Fix: [#72] github api error catch 구현

This commit is contained in:
sm4640
2025-07-17 22:01:54 +09:00
parent 72725e06b5
commit 08e99bc962

View File

@@ -115,8 +115,11 @@ class GithubTokenService:
timeout=10, timeout=10,
) )
resp.raise_for_status() resp.raise_for_status()
print(resp.json()) data = resp.json()
return resp.json() if "error" in data:
msg = data.get("error_description", data["error"])
raise Exception(f"GitHub token exchange failed: {msg}")
return data
except requests.HTTPError as e: except requests.HTTPError as e:
raise Exception( raise Exception(
f"Github token exchange failed: {e.response.status_code} - {e.response.text}" f"Github token exchange failed: {e.response.status_code} - {e.response.text}"