You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have provided sufficient information below to help reproduce this issue.
Summary
Whenever accessing st.secrets in an app, Streamlit raises exceptions in two different manners [see source]:
using st.exception(...)
raising an actual FileNotFoundError exception
This leads to two issues:
Duplicated exception messages being shown (even more, weirdly)
Makes it impossible to test if secrets exist without an exception to be written
Reproducible Code Example
token=Nonetry:
if"TOKEN"inst.secrets:
token=st.secrets["TOKEN"]
exceptFileNotFoundError:
passifnottoken:
token=st.text_input("Pass in your token!", type="password")
Steps To Reproduce
No response
Expected Behavior
Do not show any exception, since I'm trying to catch it. Basically, get rid of lines 212 and 213 in here!
Checklist
Summary
Whenever accessing
st.secrets
in an app, Streamlit raises exceptions in two different manners [see source]:st.exception(...)
FileNotFoundError
exceptionThis leads to two issues:
Reproducible Code Example
Steps To Reproduce
No response
Expected Behavior
Do not show any exception, since I'm trying to catch it. Basically, get rid of lines 212 and 213 in here!
streamlit/lib/streamlit/runtime/secrets.py
Lines 212 to 213 in 940bd5d
Current Behavior
An exception message is hard-coded and shown regardless if I catch it
Is this a regression?
Debug info
Additional Information
No response
The text was updated successfully, but these errors were encountered: