Upload app.py
Browse filesmore error messaging for feedback
app.py
CHANGED
|
@@ -560,6 +560,9 @@ def build_feedback(components: LoggedComponents) -> gr.Blocks:
|
|
| 560 |
)
|
| 561 |
gr.Info("Thank you for providing feedback!")
|
| 562 |
except Exception as ex:
|
|
|
|
|
|
|
|
|
|
| 563 |
raise gr.Error(f"Failed to submit feedback: {ex}")
|
| 564 |
|
| 565 |
with gr.Blocks(theme=gr.themes.Soft(), title="LOI writer") as demo:
|
|
|
|
| 560 |
)
|
| 561 |
gr.Info("Thank you for providing feedback!")
|
| 562 |
except Exception as ex:
|
| 563 |
+
if hasattr(ex, "response"):
|
| 564 |
+
error_msg = ex.response.json().get("response", {}).get("error")
|
| 565 |
+
raise gr.Error(f"Failed to submit feedback: {ex} :: {error_msg}")
|
| 566 |
raise gr.Error(f"Failed to submit feedback: {ex}")
|
| 567 |
|
| 568 |
with gr.Blocks(theme=gr.themes.Soft(), title="LOI writer") as demo:
|