EnkaNetwork.py
EnkaNetwork.py copied to clipboard
Add Base Class for Handling EnkaNetwork Errors
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."""
...