Skip to content

Exceptions

All library-specific errors are in tju.exceptions and inherit from the built-in Exception. Catch these to handle errors attributable to the library layer without catching unrelated exceptions.

tju.exceptions

Library-specific exceptions raised by tju.

All exceptions are importable from tju.exceptions. Client code should catch these rather than bare Exception so that errors are attributable to the library layer.

SessionError

Bases: Exception

Raised when the HTTP session cannot be created (e.g. missing credentials).

Source code in src/tju/exceptions.py
class SessionError(Exception):
    """Raised when the HTTP session cannot be created (e.g. missing credentials)."""

HtmlParseError

Bases: Exception

Raised when an EAMS HTML response does not match the expected structure.

Source code in src/tju/exceptions.py
class HtmlParseError(Exception):
    """Raised when an EAMS HTML response does not match the expected structure."""

LoginError

Bases: Exception

Raised when the SSO CAS login fails (bad credentials or captcha failure).

Source code in src/tju/exceptions.py
class LoginError(Exception):
    """Raised when the SSO CAS login fails (bad credentials or captcha failure)."""

DataError

Bases: Exception

Raised when returned data is structurally invalid or logically inconsistent.

Source code in src/tju/exceptions.py
class DataError(Exception):
    """Raised when returned data is structurally invalid or logically inconsistent."""

StuTypeError

Bases: Exception

Raised when an unsupported student type is passed to a client method.

Source code in src/tju/exceptions.py
class StuTypeError(Exception):
    """Raised when an unsupported student type is passed to a client method."""