dnplus / streamlit-oauth

Simple OAuth Component for Streamlit App
MIT License
111 stars 18 forks source link

Make StreamlitOauthError inherit from Exception #20

Closed Vidminas closed 5 months ago

Vidminas commented 5 months ago

The StreamlitOauthError (in https://github.com/dnplus/streamlit-oauth/blob/main/streamlit_oauth/__init__.py#L29) is defined as:

class StreamlitOauthError:
  """
  Exception raised from streamlit-oauth.
  """

If there is a saved state mismatch, on https://github.com/dnplus/streamlit-oauth/blob/main/streamlit_oauth/__init__.py#L98 it is raised with error text as follows: raise StreamlitOauthError(f"STATE {state} DOES NOT MATCH OR OUT OF DATE")

When triggered, this leads to TypeError: StreamlitOauthError() takes no arguments.

To resolve this, StreamlitOauthError should inherit from the built-in Exception class.

dnplus commented 5 months ago

merged with #21