Skip to content

Add Base Class for Handling EnkaNetwork Errors #29

Description

@luoshuijs

Our hope is to create a base class that can gracefully catch exceptions thrown from the EnkaNetwork.py module

class EnkaNetworError(Exception):
    """Base class for EnkaNetwork errors."""


class NetworkError(EnkaNetworError):
    """Base class for exceptions due to networking errors."""


class TimedOut(NetworkError):
    """Raised when a request took too long to finish."""


class BadRequest(EnkaNetworError):
    """Raised when EnkaNetwork could not process the request correctly."""


class EnkaValidateFailed(BadRequest):
    """Exception that's raised for when status code 400 occurs."""


...

Metadata

Metadata

Assignees

No one assigned

    Labels

    helpfulThis issues or pull so very help this project

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions