
    9Yfc                         d Z  G d de      Z G d de      Z G d de      Z G d de      Z G d	 d
e      Z G d de      Z G d de      Z G d de      Z	y)z 
API & HTTP Clients exceptions.
c                       e Zd ZdZy)DatadogExceptiona  
    Base class for Datadog API exceptions.  Use this for patterns like the following:

        try:
            # do something with the Datadog API
        except datadog.api.exceptions.DatadogException:
            # handle any Datadog-specific exceptions
    N__name__
__module____qualname____doc__     V/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/datadog/api/exceptions.pyr   r   	   s    r
   r   c                   "     e Zd ZdZ fdZ xZS )
ProxyErrorz@
    HTTP connection to the configured proxy server failed.
    c                 R    dj                  ||      }t        t        |   |       y )NzqCould not request {method} {url}: Unable to connect to proxy. Please check the proxy configuration and try again.)methodurl)formatsuperr   __init__selfr   r   	exceptionmessage	__class__s        r   r   zProxyError.__init__   s/    CCI6QW]`6Ca 	 	j$(1r
   r   r   r   r   r   __classcell__r   s   @r   r   r      s    2 2r
   r   c                   "     e Zd ZdZ fdZ xZS )ClientErrorz>
    HTTP connection to Datadog endpoint is not possible.
    c                 T    dj                  |||      }t        t        |   |       y )NzCould not request {method} {url}: {exception}. Please check the network connection or try again later. If the problem persists, please contact support@datadoghq.com)r   r   r   )r   r   r   r   r   s        r   r   zClientError.__init__&   s8    MMSV3) NT N 	 	k4)'2r
   r   r   s   @r   r   r   !       3 3r
   r   c                   "     e Zd ZdZ fdZ xZS )HttpTimeoutz"
    HTTP connection timeout.
    c                 T    dj                  |||      }t        t        |   |       y )Nz{method} {url} timed out after {timeout}. Please try again later. If the problem persists, please contact support@datadoghq.com)r   r   timeout)r   r   r!   r   )r   r   r   r#   r   r   s        r   r   zHttpTimeout.__init__6   s8    MMSV3 NT N 	 	k4)'2r
   r   r   s   @r   r!   r!   1   r   r
   r!   c                   "     e Zd ZdZ fdZ xZS )HttpBackoffz.
    Backing off after too many timeouts.
    c                 P    dj                  |      }t        t        |   |       y )NzAToo many timeouts. Won't try again for {backoff_period} seconds. )backoff_period)r   r   r%   r   )r   r'   r   r   s      r   r   zHttpBackoff.__init__F   s-    V]]) ^ 
 	k4)'2r
   r   r   s   @r   r%   r%   A   s    3 3r
   r%   c                   $     e Zd ZdZd fd	Z xZS )	HTTPErrorz(
    Datadog returned a HTTP error.
    c                 ~    |rdj                  |      nd}dj                  ||      }t        t        |   |       y )Nz - {reason})reason zDatadog returned a bad HTTP response code: {status_code}{reason}. Please try again later. If the problem persists, please contact support@datadoghq.com)status_coder+   )r   r   r)   r   )r   r-   r+   r   r   s       r   r   zHTTPError.__init__R   sN    9?&&f&5SMMSV' NT N 	 	i'0r
   )NNr   r   s   @r   r)   r)   M   s    1 1r
   r)   c                       e Zd ZdZy)ApiErrorz
    Datadog returned an API error (known HTTPError).

    Matches the following status codes: 400, 401, 403, 404, 409, 429.
    Nr   r	   r
   r   r/   r/   `   s    r
   r/   c                       e Zd ZdZy)ApiNotInitializedzNo API key is setNr   r	   r
   r   r1   r1   h   s    r
   r1   N)
r   	Exceptionr   r   r   r!   r%   r)   r/   r1   r	   r
   r   <module>r3      sq   
y 
2! 
23" 3 3" 3 	3" 	31  1& ( r
   