Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -130,7 +130,9 @@ def get_repo_contents(url):
|
|
| 130 |
try:
|
| 131 |
api = HfApi()
|
| 132 |
api.list_repo_files(repo_id=f'{owner}/{repo}', repo_type="space") # Pre-check
|
| 133 |
-
|
|
|
|
|
|
|
| 134 |
files = get_hf_files(owner, repo)
|
| 135 |
if not files: # Empty list is valid, but check for errors
|
| 136 |
raise Exception("No files found in the Hugging Face Space")
|
|
|
|
| 130 |
try:
|
| 131 |
api = HfApi()
|
| 132 |
api.list_repo_files(repo_id=f'{owner}/{repo}', repo_type="space") # Pre-check
|
| 133 |
+
except Exception as e:
|
| 134 |
+
raise Exception("HfApi Error")
|
| 135 |
+
|
| 136 |
files = get_hf_files(owner, repo)
|
| 137 |
if not files: # Empty list is valid, but check for errors
|
| 138 |
raise Exception("No files found in the Hugging Face Space")
|