Skip to content

Commit

Permalink
add clear message in example
Browse files Browse the repository at this point in the history
  • Loading branch information
mconflitti-pbc committed Jan 27, 2025
1 parent f4775c3 commit b12d578
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/posit/connect/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,14 @@ def with_user_session_token(self, token: str) -> Client:
... if token:
... return base_client.with_user_session_token(token)
... else:
... return base_client
... return None
>>> # Simulate request without header
>>> mock_request = requests.Request()
>>> client = get_client(mock_request) # Returns original client
>>> client = get_client(mock_request)
>>> if client:
... # perform actions with SDK
... else:
... print("This app requires a user session token to operate.")
"""
if token is None or token == "":
raise ValueError("token must be set to non-empty string.")
Expand Down

0 comments on commit b12d578

Please sign in to comment.