
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3
,î[ï	  ã               @   st   d Z ddlmZ ddlmZmZ G dd„ deƒZG dd„ deƒZG dd	„ d	eƒZ	G d
d„ deƒZ
G dd„ deƒZdS )z¿
oauthlib.oauth1.rfc5849.errors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error used both by OAuth 1 clients and provicers to represent the spec
defined error responses for all four core grant types.
é    )Úunicode_literals)Úadd_params_to_uriÚ	urlencodec                   sF   e Zd ZdZdZd‡ fdd„	Zdd„ Zedd	„ ƒZed
d„ ƒZ	‡  Z
S )ÚOAuth1ErrorNÚ é�  c                sP   |p| j | _ d| j| j f }|r0|dt|ƒ 7 }tt| ƒj|ƒ || _|| _dS )a®  
        description:    A human-readable ASCII [USASCII] text providing
                        additional information, used to assist the client
                        developer in understanding the error that occurred.
                        Values for the "error_description" parameter MUST NOT
                        include characters outside the set
                        x20-21 / x23-5B / x5D-7E.

        uri:    A URI identifying a human-readable web page with information
                about the error, used to provide the client developer with
                additional information about the error.  Values for the
                "error_uri" parameter MUST conform to the URI- Reference
                syntax, and thus MUST NOT include characters outside the set
                x21 / x23-5B / x5D-7E.

        state:  A CSRF protection value received from the client.

        request:  Oauthlib Request object
        z(%s) %sú N)ÚdescriptionÚerrorÚreprÚsuperr   Ú__init__ÚuriÚstatus_code)Úselfr	   r   r   ZrequestÚmessage)Ú	__class__© ú/usr/lib/python3.6/errors.pyr      s    zOAuth1Error.__init__c             C   s   t || jƒS )N)r   Ú	twotuples)r   r   r   r   r   Úin_uri0   s    zOAuth1Error.in_uric             C   s<   d| j fg}| jr"|jd| jfƒ | jr8|jd| jfƒ |S )Nr
   Zerror_descriptionZ	error_uri)r
   r	   Úappendr   )r   r
   r   r   r   r   3   s    zOAuth1Error.twotuplesc             C   s
   t | jƒS )N)r   r   )r   r   r   r   Ú
urlencoded<   s    zOAuth1Error.urlencoded)NNr   N)Ú__name__Ú
__module__Ú__qualname__r
   r	   r   r   Úpropertyr   r   Ú__classcell__r   r   )r   r   r      s    	r   c               @   s   e Zd ZdZdZdS )ÚInsecureTransportErrorZinsecure_transport_protocolz%Only HTTPS connections are permitted.N)r   r   r   r
   r	   r   r   r   r   r   A   s   r   c               @   s   e Zd ZdZdS )ÚInvalidSignatureMethodErrorZinvalid_signature_methodN)r   r   r   r
   r   r   r   r   r   F   s   r   c               @   s   e Zd ZdZdS )ÚInvalidRequestErrorZinvalid_requestN)r   r   r   r
   r   r   r   r   r    J   s   r    c               @   s   e Zd ZdZdS )ÚInvalidClientErrorZinvalid_clientN)r   r   r   r
   r   r   r   r   r!   N   s   r!   N)Ú__doc__Z
__future__r   Zoauthlib.commonr   r   Ú	Exceptionr   r   r   r    r!   r   r   r   r   Ú<module>   s   3