"""Exceptions that are raised inside library."""
[docs]class GithubcapException(Exception):
"""Base class for githubcap exception tree."""
[docs]class ConfigNotFound(GithubcapException):
"""Raised on non-existing configuration file."""
[docs]class ConfigurationError(GithubcapException):
"""Raised on invalid configuration."""
[docs]class MissingPassword(GithubcapException):
"""Raised when a user name is set but no password provided."""
[docs]class HTTPError(GithubcapException):
"""Raised on unrecoverable HTTP errors."""
def __init__(self, message: dict, status_code: int):
"""Initialize HTTP error exception."""
super().__init__(message['message'])
self.status_code = status_code
self.raw_response = message
[docs]class SchemaValidationError(GithubcapException):
"""Raised on schema validation failure."""