mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-03 17:53:20 +00:00
Merge pull request #999 from langchain-ai/yogesh/auth-logging
chore: improve GitHub auth failure logging with exception type
This commit is contained in:
commit
6f487824c9
1 changed files with 3 additions and 0 deletions
|
|
@ -183,6 +183,7 @@ async def get_github_token_for_user(ls_user_id: str, tenant_id: str) -> dict[str
|
||||||
Dict with either 'token' key or 'auth_url' key
|
Dict with either 'token' key or 'auth_url' key
|
||||||
"""
|
"""
|
||||||
if not GITHUB_OAUTH_PROVIDER_ID:
|
if not GITHUB_OAUTH_PROVIDER_ID:
|
||||||
|
logger.error("GitHub auth failed: GITHUB_OAUTH_PROVIDER_ID is not configured")
|
||||||
return {"error": "GITHUB_OAUTH_PROVIDER_ID not configured"}
|
return {"error": "GITHUB_OAUTH_PROVIDER_ID not configured"}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
@ -220,8 +221,10 @@ async def get_github_token_for_user(ls_user_id: str, tenant_id: str) -> dict[str
|
||||||
return {"error": f"Unexpected auth result: {response_data}"}
|
return {"error": f"Unexpected auth result: {response_data}"}
|
||||||
|
|
||||||
except httpx.HTTPStatusError as e:
|
except httpx.HTTPStatusError as e:
|
||||||
|
logger.error("GitHub auth API HTTP error: %s - %s", e.response.status_code, e.response.text)
|
||||||
return {"error": f"HTTP error: {e.response.status_code} - {e.response.text}"}
|
return {"error": f"HTTP error: {e.response.status_code} - {e.response.text}"}
|
||||||
except Exception as e: # noqa: BLE001
|
except Exception as e: # noqa: BLE001
|
||||||
|
logger.error("GitHub auth API call failed: %s: %s", type(e).__name__, str(e))
|
||||||
return {"error": str(e)}
|
return {"error": str(e)}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue