File size: 603 Bytes
469eae6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import requests


class UnauthorizedError(Exception):
    """Exception raised when the API returns a 401 Unauthorized response."""

    def __init__(self, orig_exception: requests.exceptions.HTTPError):
        self.orig_exception = orig_exception
        super().__init__(str(orig_exception))


class NotFoundError(Exception):
    """Exception raised when the API returns a 404 Not Found response or indicates a resource was not found."""

    def __init__(self, orig_exception: requests.exceptions.HTTPError):
        self.orig_exception = orig_exception
        super().__init__(str(orig_exception))