Spaces:
Running
Running
error messages for wrong inputs
#1
by
laiking
- opened
app.py
CHANGED
|
@@ -34,10 +34,10 @@ def controller(article_id:str):
|
|
| 34 |
|
| 35 |
# check whether article markdown can be displayed
|
| 36 |
if output["db"] is None :
|
| 37 |
-
gr.Error(f"Wrong format for input id : {article_id}")
|
| 38 |
return None, None, None, None
|
| 39 |
elif output["article_sections"] is None or output["filtered_sections"] is None:
|
| 40 |
-
gr.Error(f"Could not retrieve text for id {article_id} (id not found in database or abstract/fulltext unavailable on PubMed/PMC)")
|
| 41 |
return None, None, None, None
|
| 42 |
else :
|
| 43 |
article_markdown = get_article_markdown(article_id, output["article_sections"], output["filtered_sections"])
|
|
|
|
| 34 |
|
| 35 |
# check whether article markdown can be displayed
|
| 36 |
if output["db"] is None :
|
| 37 |
+
gr.Error(f"Wrong format for input id : {article_id}",duration=5, visible=True)
|
| 38 |
return None, None, None, None
|
| 39 |
elif output["article_sections"] is None or output["filtered_sections"] is None:
|
| 40 |
+
gr.Error(f"Could not retrieve text for id {article_id} (id not found in database or abstract/fulltext unavailable on PubMed/PMC)",duration=5, visible=True)
|
| 41 |
return None, None, None, None
|
| 42 |
else :
|
| 43 |
article_markdown = get_article_markdown(article_id, output["article_sections"], output["filtered_sections"])
|