MCPcopy Create free account
hub / github.com/streamlit/streamlit / StreamlitAPIException

Class StreamlitAPIException

lib/streamlit/errors.py:87–102  ·  view source on GitHub ↗

Base class for Streamlit API exceptions. An API exception should be thrown when user code interacts with the Streamlit API incorrectly. (That is, when we throw an exception as a result of a user's malformed `st.foo` call, it should be a StreamlitAPIException or subclass.) When

Source from the content-addressed store, hash-verified

85
86
87class StreamlitAPIException(MarkdownFormattedException):
88 """Base class for Streamlit API exceptions.
89
90 An API exception should be thrown when user code interacts with the
91 Streamlit API incorrectly. (That is, when we throw an exception as a
92 result of a user's malformed `st.foo` call, it should be a
93 StreamlitAPIException or subclass.)
94
95 When displaying these exceptions on the frontend, we strip Streamlit
96 entries from the stack trace so that the user doesn't see a bunch of
97 noise related to Streamlit internals.
98
99 """
100
101 def __repr__(self) -> str:
102 return util.repr_(self)
103
104
105class DuplicateWidgetID(StreamlitAPIException): # pragma: no cover - trivial subclass

Callers 15

test_markdown_flagMethod · 0.90
set_user_optionFunction · 0.90
validate_emojiFunction · 0.90
validate_material_iconFunction · 0.90
check_python_comparableFunction · 0.90
adjust_yearsFunction · 0.90
wrapperMethod · 0.90
_enqueueMethod · 0.90
__setattr__Method · 0.90
__setitem__Method · 0.90
__setattr__Method · 0.90
__setitem__Method · 0.90

Calls

no outgoing calls

Tested by 1

test_markdown_flagMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…