Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

DM-38279: Do all spawning work in start #14

Merged
merged 6 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions src/rsp_restspawner/errors.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
from httpx import Response
"""Exceptions for the RSP REST spawner.

JupyterHub catches all exceptions derived from `Exception` and treats them the
same, so the distinction between exceptions is just for better error reporting
and improved code readability.
"""

class SpawnerError(Exception):
def __init__(self, response: Response) -> None:
self._response = response

def __str__(self) -> str:
r = self._response
sc = r.status_code
rp = r.reason_phrase
txt = r.text
url = r.url
return f"Request for {url}: status code {sc} ({rp}): '{txt}'"
class InvalidAuthStateError(Exception):
"""The JupyterHub auth state for the user contains no token."""


class MissingFieldError(Exception):
pass

"""The reply from the lab controller is missing a required field."""

class EventError(Exception):
pass


class InvalidAuthStateError(Exception):
"""The JupyterHub auth state for the user contains no token."""
class SpawnFailedError(Exception):
"""The lab controller reports that the spawn failed."""
Loading