chore:updated logging

This commit is contained in:
aran-yogesh 2026-03-02 14:49:07 -08:00
parent 1241028dc3
commit 257f08b196

View file

@ -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
"""
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"}
try:
@ -220,9 +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}"}
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}"}
except Exception as e: # noqa: BLE001
logger.warning("GitHub auth API call failed: %s: %s", type(e).__name__, str(e))
logger.error("GitHub auth API call failed: %s: %s", type(e).__name__, str(e))
return {"error": str(e)}
@ -559,11 +561,7 @@ async def process_linear_issue( # noqa: PLR0912, PLR0915
await comment_on_linear_issue(issue_id, comment)
return
else:
logger.warning(
"Auth result has neither token nor auth_url: %s (error=%r)",
auth_result,
auth_result.get("error"),
)
logger.warning("Auth result has neither token nor auth_url: %s", auth_result)
else:
logger.warning("User %s not found in LangSmith workspace", user_email)
comment = (