U
    ^g:                     @   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.    )Response)
exceptions   )Optional)Limitc                       s0   e Zd ZdZdeee dd fddZ  ZS )RateLimitExceededz*Exception raised when a rate limit is hit.N)limitresponsereturnc                    sJ   || _ || _|jr,t|js"|jn| }n
t|j }t j||d dS )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__ 8/tmp/pip-unpacked-wheel-8ut481ky/flask_limiter/errors.pyr      s    
zRateLimitExceeded.__init__)N)	__name__
__module____qualname____doc__r   r   r   r   __classcell__r   r   r   r   r   
   s   r   N)r   Zflask.wrappersr   Zwerkzeugr   typingr   wrappersr   ZTooManyRequestsr   r   r   r   r   <module>   s
   