File size: 443 Bytes
4b243fa
 
 
 
2a351ef
2411fa7
4b243fa
2a351ef
 
 
4b243fa
 
 
2411fa7
4b243fa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from typing import Optional

import streamlit as st

ERROR_MESSAGE = (
    "Sorry, we encountered an unexpected error.\n\n"
    "Please refresh the page or try again later. "
    "If the error persists, please contact us at "
    "[Tall Tree Health](https://www.talltreehealth.ca/contact-us)."
)


def handle_errors(error: Optional[Exception] = None):
    st.warning(error if error else ERROR_MESSAGE, icon="⚠")
    st.stop()