shiny.session.require_active_session#

shiny.session.require_active_session(session)#

Raise an exception if no Shiny session is currently active.

Parameters

session (Optional[Session]) – A Session instance. If not provided, it is inferred via get_current_session().

Return type

The session.

Note

Shiny apps should not need to call this function directly. Instead, it’s intended to be used by Shiny developing who wish to create new functions that should only be called from within an active Shiny session.

Raises

ValueError – If session is not active.