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()