Spaces:
Running
Running
Commit
·
2f08ce9
1
Parent(s):
cd00772
feat: add error detail log
Browse files- competitions/app.py +2 -0
competitions/app.py
CHANGED
|
@@ -3,6 +3,7 @@ import os
|
|
| 3 |
import threading
|
| 4 |
import time
|
| 5 |
import io
|
|
|
|
| 6 |
from typing import Dict, Any, List, Optional
|
| 7 |
from urllib.parse import urlencode
|
| 8 |
|
|
@@ -351,6 +352,7 @@ def new_submission(
|
|
| 351 |
return {"response": f"Success! You have {resp} submissions remaining today."}
|
| 352 |
return {"response": "Invalid competition type"}
|
| 353 |
except RequestException:
|
|
|
|
| 354 |
return {"response": "Hugging Face Hub is unreachable, please try again later"}
|
| 355 |
except AuthenticationError:
|
| 356 |
return {"response": "Invalid token"}
|
|
|
|
| 3 |
import threading
|
| 4 |
import time
|
| 5 |
import io
|
| 6 |
+
import traceback
|
| 7 |
from typing import Dict, Any, List, Optional
|
| 8 |
from urllib.parse import urlencode
|
| 9 |
|
|
|
|
| 352 |
return {"response": f"Success! You have {resp} submissions remaining today."}
|
| 353 |
return {"response": "Invalid competition type"}
|
| 354 |
except RequestException:
|
| 355 |
+
logger.error("Hugging Face Hub is unreachable, please try again later:", traceback.format_exc())
|
| 356 |
return {"response": "Hugging Face Hub is unreachable, please try again later"}
|
| 357 |
except AuthenticationError:
|
| 358 |
return {"response": "Invalid token"}
|