✏️ Fix: [#72] github api error catch 구현
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user