Merge pull request #80 from plers-org/sm/#72

✏️ Fix: [#72] github api error catch 구현
This commit is contained in:
NKEY
2025-07-17 22:04:45 +09:00
committed by GitHub

View File

@@ -115,8 +115,11 @@ class GithubTokenService:
timeout=10,
)
resp.raise_for_status()
print(resp.json())
return resp.json()
data = 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:
raise Exception(
f"Github token exchange failed: {e.response.status_code} - {e.response.text}"