o
    #`^h                     @   s|   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eeZ	ed	d
edG dd de	Z
G dd de	ZdS )zlinebot.exceptions module.    )ABCMeta)with_metaclass)
deprecated   )LineBotSdkDeprecatedIn30c                   @   s*   e Zd ZdZd
ddZdd Zdd Zd	S )	BaseErrorzBase Exception class.-c                 C   s
   || _ dS zM__init__ method.

        :param str message: Human readable message
        N)messageselfr
    r   P/home/air/shanriGPT/back/venv/lib/python3.10/site-packages/linebot/exceptions.py__init__   s   
zBaseError.__init__c                 C   s   t | S )zrepr.)strr   r   r   r   __repr__&   s   zBaseError.__repr__c                 C   s   d | jj| jS )"str.

        :rtype: str
        z<{0} [{1}]>)format	__class____name__r
   r   r   r   r   __str__*   s   
zBaseError.__str__Nr   )r   
__module____qualname____doc__r   r   r   r   r   r   r   r      s
    
r   zUse 'from linebot.v3.exceptions import InvalidSignatureError' and v3 webhook handlers instead. See https://github.com/line/line-bot-sdk-python/blob/master/README.rst for more details.z3.0.0)reasonversioncategoryc                       s"   e Zd ZdZd fdd	Z  ZS )InvalidSignatureErrorzAWhen Webhook signature does NOT match, this error will be raised.r   c                    s   t t| | dS r	   )superr   r   r   r   r   r   r   7   s   zInvalidSignatureError.__init__r   )r   r   r   r   r   __classcell__r   r   r!   r   r   3   s    r   c                       s0   e Zd ZdZ			d fdd	Zdd Z  ZS )LineBotApiErrorzBWhen LINE Messaging API response error, this error will be raised.Nc                    s4   t t| |j || _|| _|| _|| _|| _dS )a  __init__ method.

        :param int status_code: HTTP status code
        :param headers: Response headers
        :type headers: dict[str, str]
        :param str request_id: (optional) Request ID. A unique ID is generated for each request
        :param str accepted_request_id: (optional) The same request has already been accepted
        :param error: (optional) Error class object.
        :type error: :py:class:`linebot.models.error.Error`
        N)	r    r#   r   r
   status_codeheaders
request_idaccepted_request_iderror)r   r$   r%   r&   r'   r(   r!   r   r   r   B   s   
zLineBotApiError.__init__c                 C   sF   | j rd| jj| j| j| j | j| jS d| jj| j| j| j| jS )r   z^{0}: status_code={1}, request_id={2}, accepted_request_id={3}, error_response={4}, headers={5}zE{0}: status_code={1}, request_id={2}, error_response={3}, headers={4})r'   r   r   r   r$   r&   r(   r%   r   r   r   r   r   \   s   zLineBotApiError.__str__)NNN)r   r   r   r   r   r   r"   r   r   r!   r   r#   ?   s    r#   N)r   abcr   future.utilsr   r   deprecationsr   	Exceptionr   r   r#   r   r   r   r   <module>   s   