Skip to content

Commit

Permalink
Log the error message from logging into JupyterHub
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansick committed May 3, 2024
1 parent c40f8f1 commit 3df9d54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/noteburst/jupyterclient/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ async def create(
},
json=token_request_data,
)
print(r.json()) # noqa: T201
r.raise_for_status()
body = r.json()
return cls(
Expand Down
8 changes: 7 additions & 1 deletion src/noteburst/worker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ async def startup(ctx: dict[Any, Any]) -> None:
jupyter_client = JupyterClient(
user=authed_user, logger=logger, config=jupyter_config
)
await jupyter_client.log_into_hub()
try:
await jupyter_client.log_into_hub()
except httpx.HTTPStatusError as e:
logger.exception(
"Error logging into JupyterHub",
body=e.response.json(),
)
try:
image_info = await jupyter_client.spawn_lab()
logger = logger.bind(image_ref=image_info.reference)
Expand Down

0 comments on commit 3df9d54

Please sign in to comment.