30 lines
675 B
Python
30 lines
675 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
|
||
|
|
|
||
|
|
def __init__(
|
||
|
|
self,
|
||
|
|
orig_exception: requests.exceptions.RequestException,
|
||
|
|
func_name: str,
|
||
|
|
func_kwargs: None | dict,
|
||
|
|
):
|
||
|
|
self.orig_exception = orig_exception
|
||
|
|
self.func_name = func_name
|
||
|
|
self.func_kwargs = func_kwargs
|