
    {i                       S r SSKJr  SSKJrJr  SSKJr  \(       a  SSKJ	r	   " S S\
5      r " S S	\5      r " S
 S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S  S!\5      r " S" S#\5      r " S$ S%\5      r " S& S'\5      r " S( S)\5      r " S* S+\5      rg,)-z3Provide exception classes for the prawcore package.    )annotations)TYPE_CHECKINGAny)urlparse)Responsec                      \ rS rSrSrSrg)PrawcoreException   zCBase exception class for exceptions that occur within this package. N__name__
__module____qualname____firstlineno____doc____static_attributes__r       M/home/james-whalen/.local/lib/python3.13/site-packages/prawcore/exceptions.pyr	   r	      s    Mr   r	   c                      \ rS rSrSrSrg)InvalidInvocation   z6Indicate that the code to execute cannot be completed.r   Nr   r   r   r   r   r      s    @r   r   c                  6    \ rS rSrSr S       SS jjrSrg)OAuthException   zAIndicate that there was an OAuth2 related error with the request.Nc                |    X l         X0l        Xl        U S3nU(       a	  USU S3-  n[        R	                  X5        g)zInitialize a OAuthException instance.

:param response: A ``requests.response`` instance.
:param error: The error type returned by Reddit.
:param description: A description of the error when provided.

z error processing requestz ()N)errordescriptionresponser	   __init__)selfr   r   r   messages        r   r    OAuthException.__init__   sE     
& G45K=**G""41r   )r   r   r   )N)r   r   r   strr   z
str | NonereturnNoner   r   r   r   r   r    r   r   r   r   r   r      s6    K IM2 2),2;E2	2 2r   r   c                  @   ^  \ rS rSrSr        SU 4S jjrSrU =r$ )RequestException)   zBIndicate that there was an error with the incomplete HTTP request.c                N   > Xl         X l        X0l        [        TU ]  SU 35        g)zInitialize a RequestException instance.

:param original_exception: The original exception that occurred.
:param request_args: The arguments to the request function.
:param request_kwargs: The keyword arguments to the request function.

zerror with request N)original_exceptionrequest_argsrequest_kwargssuperr    )r!   r,   r-   r.   	__class__s       r   r    RequestException.__init__,   s.     #5(,./A.BCDr   )r,   r-   r.   )r,   	Exceptionr-   ztuple[Any, ...]r.   zBdict[str, bool | (dict[str, int] | (dict[str, str] | str)) | None]r%   r&   r   r   r   r   r   r    r   __classcell__r0   s   @r   r)   r)   )   s<    LE%E &E
	E 
E Er   r)   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )ResponseExceptionA   zAIndicate that there was an error with the completed HTTP request.c                L   > Xl         [        TU ]	  SUR                   S35        g)z^Initialize a ResponseException instance.

:param response: A ``requests.response`` instance.

	received  HTTP responseN)r   r/   r    status_code)r!   r   r0   s     r   r    ResponseException.__init__D   s'     !9X%9%9$:.IJr   )r   r   r   r%   r&   r3   r5   s   @r   r7   r7   A   s    KK Kr   r7   c                      \ rS rSrSrSrg)BadJSONN   z1Indicate the response did not contain valid JSON.r   Nr   r   r   r   r@   r@   N   s    ;r   r@   c                      \ rS rSrSrSrg)
BadRequestR   z,Indicate invalid parameters for the request.r   Nr   r   r   r   rC   rC   R   s    6r   rC   c                      \ rS rSrSrSrg)ConflictV   z5Indicate a conflicting change in the target resource.r   Nr   r   r   r   rF   rF   V       ?r   rF   c                      \ rS rSrSrSrg)	ForbiddenZ   z=Indicate the authentication is not permitted for the request.r   Nr   r   r   r   rJ   rJ   Z   s    Gr   rJ   c                      \ rS rSrSrSrg)InsufficientScope^   z5Indicate that the request requires a different scope.r   Nr   r   r   r   rM   rM   ^   rH   r   rM   c                      \ rS rSrSrSrg)InvalidTokenb   z7Indicate that the request used an invalid access token.r   Nr   r   r   r   rP   rP   b   s    Ar   rP   c                      \ rS rSrSrSrg)NotFoundf   z.Indicate that the requested URL was not found.r   Nr   r   r   r   rS   rS   f   s    8r   rS   c                  "    \ rS rSrSrSS jrSrg)Redirectj   zIndicate the request resulted in a redirect.

This class adds the attribute ``path``, which is the path to which the response
redirects.

c                   [        UR                  S   5      R                  nUR                  S5      (       a  USS OUU l        Xl        SU R                   3nUSU R                  ;   a  SOS-  n[
        R                  X5        g)	z|Initialize a Redirect exception instance.

:param response: A ``requests.response`` instance containing a location header.

locationz.jsonNzRedirect to z/login/zP (You may be trying to perform a non-read-only action via a read-only instance.) )r   headerspathendswithr   r	   r    )r!   r   r]   msgs       r   r    Redirect.__init__r   s     ((45::!%w!7!7D"IT	 TYYK( DII%# 		
 	""4-r   )r]   r   Nr>   r'   r   r   r   rV   rV   j   s    .r   rV   c                      \ rS rSrSrSrg)ServerError   zAIndicate issues on the server end preventing request fulfillment.r   Nr   r   r   r   rb   rb      s    Kr   rb   c                  "    \ rS rSrSrSS jrSrg)SpecialError   z*Indicate syntax or spam-prevention issues.c                   Xl         U R                   R                  5       nUR                  SS5      U l        UR                  SS5      U l        UR                  S/ 5      U l        [        R                  U SU R                  < 35        g)zInitialize a SpecialError exception instance.

:param response: A ``requests.response`` instance containing a message and a
    list of special errors.

r"   r[   reasonspecial_errorszSpecial error N)r   jsongetr"   rh   ri   r	   r    )r!   r   	resp_dicts      r   r    SpecialError.__init__   so     !MM&&(	 }}Y3mmHb1'mm,<bA""4>$,,9I)JKr   )r"   rh   r   ri   Nr>   r'   r   r   r   re   re      s    4Lr   re   c                      \ rS rSrSrSrg)TooLarge   z9Indicate that the request data exceeds the allowed limit.r   Nr   r   r   r   ro   ro      s    Cr   ro   c                  "    \ rS rSrSrSS jrSrg)TooManyRequests   zLIndicate that the user has sent too many requests in a given amount of time.c                   Xl         UR                  R                  S5      U l        UR                  U l        SUR                   S3nU R                  (       a  US[        U R                  5       S3-  n[        R                  X5        g)zInitialize a TooManyRequests exception instance.

:param response: A ``requests.response`` instance that may contain a retry-after
    header and a message.

zretry-afterr:   r;   z. Please wait at least z' seconds before re-trying this request.N)
r   r\   rk   retry_aftertextr"   r<   floatr	   r    )r!   r   r_   s      r   r    TooManyRequests.__init__   s     !#++//>}}(../~>)%0@0@*A)B C+ ,C 	""4-r   )r"   r   ru   Nr>   r'   r   r   r   rr   rr      s
    V.r   rr   c                      \ rS rSrSrSrg)
URITooLong   zFIndicate that the length of the request URI exceeds the allowed limit.r   Nr   r   r   r   rz   rz      s    Pr   rz   c                      \ rS rSrSrSrg)UnavailableForLegalReasons   zDIndicate that the requested URL is unavailable due to legal reasons.r   Nr   r   r   r   r}   r}      s    Nr   r}   N)r   
__future__r   typingr   r   urllib.parser   requests.modelsr   r2   r	   r   r   r)   r7   r@   rC   rF   rJ   rM   rP   rS   rV   rb   re   ro   rr   rz   r}   r   r   r   <module>r      s'   9 " % !(N	 NA) A2& 2,E( E0
K) 
K< <7" 7@  @H! H@) @B$ B9  9.  .6L# LL$ L&D  D.' ..Q" QO!2 Or   