Skip to content

Exceptions

papertrail.exceptions

Custom exceptions for the papertrail package.

PapertrailError

Bases: Exception

Base exception for all papertrail errors.

Source code in src/papertrail/exceptions.py
class PapertrailError(Exception):
    """Base exception for all papertrail errors."""

AuthorNotFoundError

Bases: PapertrailError

Raised when no author matches the given name or ID.

Source code in src/papertrail/exceptions.py
class AuthorNotFoundError(PapertrailError):
    """Raised when no author matches the given name or ID."""

MultipleAuthorsFoundError

Bases: PapertrailError

Raised when a name matches multiple authors and disambiguation is needed.

Attributes:

Name Type Description
candidates

List of candidate author display names and IDs.

Source code in src/papertrail/exceptions.py
class MultipleAuthorsFoundError(PapertrailError):
    """Raised when a name matches multiple authors and disambiguation is needed.

    Attributes:
        candidates: List of candidate author display names and IDs.
    """

    def __init__(self, message: str, candidates: list[str]) -> None:
        super().__init__(message)
        self.candidates = candidates

FetchError

Bases: PapertrailError

Raised when an external API request fails.

Source code in src/papertrail/exceptions.py
class FetchError(PapertrailError):
    """Raised when an external API request fails."""

ExportError

Bases: PapertrailError

Raised when exporting data to a file fails.

Source code in src/papertrail/exceptions.py
class ExportError(PapertrailError):
    """Raised when exporting data to a file fails."""