Spaces:
Running
Running
Anirudh Esthuri
commited on
Commit
·
75aa16d
1
Parent(s):
c313857
Log OAuth token exchange errors
Browse files
app.py
CHANGED
|
@@ -88,6 +88,10 @@ def exchange_code_for_token(code: str) -> dict | None:
|
|
| 88 |
resp = requests.post(HF_TOKEN_URL, data=payload, timeout=15)
|
| 89 |
resp.raise_for_status()
|
| 90 |
return resp.json()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
except Exception as e:
|
| 92 |
st.error(f"Failed to exchange auth code: {e}")
|
| 93 |
return None
|
|
|
|
| 88 |
resp = requests.post(HF_TOKEN_URL, data=payload, timeout=15)
|
| 89 |
resp.raise_for_status()
|
| 90 |
return resp.json()
|
| 91 |
+
except requests.HTTPError as http_err:
|
| 92 |
+
detail = http_err.response.text if http_err.response is not None else ""
|
| 93 |
+
st.error(f"Failed to exchange auth code: {http_err}. Response: {detail}")
|
| 94 |
+
return None
|
| 95 |
except Exception as e:
|
| 96 |
st.error(f"Failed to exchange auth code: {e}")
|
| 97 |
return None
|