33 lines
782 B
Python
33 lines
782 B
Python
import requests
|
|
|
|
|
|
class IncompatibleAPIError(Exception):
|
|
"""Raised when the API is incompatible"""
|
|
message: str
|
|
|
|
def __init__(
|
|
self,
|
|
message: str,
|
|
):
|
|
self.message = message
|
|
super().__init__(message)
|
|
|
|
|
|
class RequestException(Exception):
|
|
orig_exception: requests.exceptions.RequestException
|
|
func_name: str
|
|
func_kwargs: None | dict = None
|
|
status_code: None | int = None
|
|
|
|
def __init__(
|
|
self,
|
|
orig_exception: requests.exceptions.RequestException,
|
|
func_name: str,
|
|
func_kwargs: None | dict,
|
|
status_code: None | int,
|
|
):
|
|
self.orig_exception = orig_exception
|
|
self.func_name = func_name
|
|
self.func_kwargs = func_kwargs
|
|
self.status_code = status_code
|