Spaces:
Build error
Build error
Commit
·
d20aa54
1
Parent(s):
6460cc3
Return exception if raises
Browse files
app.py
CHANGED
|
@@ -95,10 +95,13 @@ def space_builder(spaces: str, hf_token: str, username: str, space_name: str, sp
|
|
| 95 |
# return "Thank you for using the draft, it will be completed later"
|
| 96 |
if spaces == "" or hf_token == "" or username == "" or space_name == "" or space_description == "":
|
| 97 |
return "Please fill all the inputs"
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
|
| 104 |
iface = gr.Interface(
|
|
|
|
| 95 |
# return "Thank you for using the draft, it will be completed later"
|
| 96 |
if spaces == "" or hf_token == "" or username == "" or space_name == "" or space_description == "":
|
| 97 |
return "Please fill all the inputs"
|
| 98 |
+
try:
|
| 99 |
+
if check_space_name_availability(hf_token, space_name):
|
| 100 |
+
return "The space_name is available"
|
| 101 |
+
else:
|
| 102 |
+
return "The space_name is already used for the token's user"
|
| 103 |
+
except Exception as ex:
|
| 104 |
+
return Exception
|
| 105 |
|
| 106 |
|
| 107 |
iface = gr.Interface(
|