
    Pqh:                     b    d Z ddlmZ ddlmZ ddlmZ ddlmZ  G d dej                        Z
y	)
zerrors and exceptions.    )Response)
exceptions   )Optional)Limitc                   8     e Zd ZdZddedee   ddf fdZ xZS )RateLimitExceededz*Exception raised when a rate limit is hit.Nlimitresponsereturnc                     || _         || _        |j                  r2t        |j                        s|j                  n|j                         }nt	        |j                         }t
        |   ||       y)aG  
        :param limit: The actual rate limit that was hit.
         Used to construct the default response message
        :param response: Optional pre constructed response. If provided
         it will be rendered by flask instead of the default error response
         of :class:`~werkzeug.exceptions.HTTPException`
        )descriptionr   N)r
   r   error_messagecallablestrsuper__init__)selfr
   r   r   	__class__s       U/srv/www/ollama/chat-ollama/venv/lib/python3.12/site-packages/flask_limiter/errors.pyr   zRateLimitExceeded.__init__   sj     
    3 34 ##((*  ekk*K[8D    )N)	__name__
__module____qualname____doc__r   r   r   r   __classcell__)r   s   @r   r	   r	   
   s/    4Ee Ex/A ET E Er   r	   N)r   flask.wrappersr   werkzeugr   typingr   wrappersr   TooManyRequestsr	    r   r   <module>r#      s(     #   E
22 Er   