st.exception
Display an exception.
When accessing the app through localhost, in the lower-right corner of the exception, Streamlit displays links to Google and ChatGPT that are prefilled with the contents of the exception message.
| Function signature[source] | |
|---|---|
st.exception(exception, width="stretch") | |
| Parameters | |
exception (Exception) | The exception to display. |
width ("stretch" or int) | The width of the exception element. This can be one of the following:
|
Example
import streamlit as st
e = RuntimeError("This is an exception of type RuntimeError")
st.exception(e)
Tip
Want a new st.exception feature or found a bug? Browse open issues and react with a 👍 on the initial post of the ones that matter to you. Your votes help us prioritize what to work on next.
Still have questions?
Our forums are full of helpful information and Streamlit experts.