Spaces:
Runtime error
Runtime error
Commit
·
439d0c0
1
Parent(s):
703dffd
catch error
Browse files
app.py
CHANGED
@@ -28,9 +28,7 @@ def relative_rank(my_dict, target_key, filter_zero=False):
|
|
28 |
my_dict = {k: v for k, v in my_dict.items() if v != 0}
|
29 |
|
30 |
if target_key not in my_dict:
|
31 |
-
raise
|
32 |
-
f"'{target_key}' not found in the dictionary or its value is 0."
|
33 |
-
)
|
34 |
|
35 |
sorted_items = sorted(my_dict.items(), key=lambda item: item[1], reverse=True)
|
36 |
|
|
|
28 |
my_dict = {k: v for k, v in my_dict.items() if v != 0}
|
29 |
|
30 |
if target_key not in my_dict:
|
31 |
+
raise gr.Error(f"'{target_key}' not found lease check the ID and try again.")
|
|
|
|
|
32 |
|
33 |
sorted_items = sorted(my_dict.items(), key=lambda item: item[1], reverse=True)
|
34 |
|