Spaces:
Runtime error
Runtime error
Yemin Shi
commited on
Commit
·
e751430
1
Parent(s):
4417ee8
add error log
Browse files
app.py
CHANGED
@@ -94,6 +94,10 @@ def post_reqest(seed, prompt, width, height, image_num, img=None, mask=None):
|
|
94 |
if r.status_code != 200:
|
95 |
raise gr.Error(r.reason)
|
96 |
create_res = r.json()
|
|
|
|
|
|
|
|
|
97 |
all_task_data.append(create_res["data"])
|
98 |
|
99 |
# Get result
|
|
|
94 |
if r.status_code != 200:
|
95 |
raise gr.Error(r.reason)
|
96 |
create_res = r.json()
|
97 |
+
if create_res['code'] == 3002:
|
98 |
+
raise gr.Error("Inappropriate prompt detected.")
|
99 |
+
elif create_res['code'] != 0:
|
100 |
+
raise gr.Error("Unknown error")
|
101 |
all_task_data.append(create_res["data"])
|
102 |
|
103 |
# Get result
|