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