o
    j*                     @  sJ   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 dej	Z
d	S )
zerrors and exceptions.    )annotations)Response)
exceptions   )RuntimeLimitc                      s$   e Zd ZdZdd fd	d
Z  ZS )RateLimitExceededz*Exception raised when a rate limit is hit.Nlimitr   responseResponse | NonereturnNonec                   sJ   || _ || _|jrt|js|jn| }nt|j }t j||d dS )aF  
        :param limit: The actual rate limit that was hit. This is 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__ I/var/www/ai-app/venv/lib/python3.10/site-packages/flask_limiter/errors.pyr      s   
zRateLimitExceeded.__init__)N)r   r   r	   r
   r   r   )__name__
__module____qualname____doc__r   __classcell__r   r   r   r   r      s    r   N)r   
__future__r   flask.wrappersr   werkzeugr   _limitsr   TooManyRequestsr   r   r   r   r   <module>   s    