Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Upload error_message_template.py
Browse files
utils/error_message_template.py
CHANGED
@@ -1,6 +1,15 @@
|
|
|
|
|
|
|
|
|
|
1 |
ERROR_MESSAGE = (
|
2 |
-
"
|
3 |
-
"Please refresh the page or try again later
|
4 |
"If the error persists, please contact us at "
|
5 |
"[Tall Tree Health](https://www.talltreehealth.ca/contact-us)."
|
6 |
)
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Optional
|
2 |
+
|
3 |
+
import streamlit as st
|
4 |
+
|
5 |
ERROR_MESSAGE = (
|
6 |
+
"Sorry, something went wrong. Our team is working on it.\n\n"
|
7 |
+
"Please refresh the page or try again later. "
|
8 |
"If the error persists, please contact us at "
|
9 |
"[Tall Tree Health](https://www.talltreehealth.ca/contact-us)."
|
10 |
)
|
11 |
+
|
12 |
+
|
13 |
+
def handle_errors(error: Optional[Exception] = None):
|
14 |
+
st.warning(error if error else ERROR_MESSAGE, icon="🙁")
|
15 |
+
st.stop()
|