Ë
    …jÐjÊ'  ã                   óf  — d Z ddlmZmZmZ ddlmZ ddlmZ  G d„ de	«      Z
 G d„ d	«      Z G d
„ de
«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de
«      Z G d „ d!e«      Zy")#aN  PRAW exception classes.

Includes two main exceptions: :class:`.RedditAPIException` for when something goes wrong
on the server side, and :class:`.ClientException` when something goes wrong on the
client side. Both of these classes extend :class:`.PRAWException`.

All other exceptions are subclassed from :class:`.ClientException`.

é    )ÚListÚOptionalÚUnion)Úwarné   )Ú_deprecate_argsc                   ó   — e Zd ZdZy)ÚPRAWExceptionz@The base PRAW Exception that all other exception classes extend.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    ú‰/var/labsstorage/home/Thilakkumar/htdocs/soical-media-automation/automation_platform/venv/lib/python3.12/site-packages/praw/exceptions.pyr
   r
      s   „ ÚJr   r
   c            	       ó¢   ‡ — e Zd ZdZedefd„«       Zded ee   f   fˆ fd„Z	 e
ddd«      d	d	d
œdedee   dee   fd„«       Zdefd„Zd„ Zˆ xZS )ÚRedditErrorItemz5Represents a single error returned from Reddit's API.Úreturnc                 ó–   — | j                   }| j                  r|d| j                  ›�z  }| j                  r|d| j                  ›�z  }|S )z'Get the completed error message string.z: z
 on field ©Ú
error_typeÚmessageÚfield)ÚselfÚ	error_strs     r   Úerror_messagezRedditErrorItem.error_message   sL   € ð —O‘Oˆ	Ø�<Š<Ø˜2˜dŸl™lÐ-Ð.Ñ.ˆIØ�:Š:Ø˜: d§j¡j ^Ð4Ñ4ˆIØÐr   Úotherc                 óÐ   •— t        |t        «      rG| j                  | j                  | j                  f|j                  |j                  |j                  fk(  S t
        ‰| �  |«      S )zCheck for equality.)Ú
isinstancer   r   r   r   ÚsuperÚ__eq__)r   r   Ú	__class__s     €r   r"   zRedditErrorItem.__eq__!   s[   ø€ ä�eœ_Ô-Ø—O‘O T§\¡\°4·:±:Ð>Ø× Ñ Ø—‘Ø—‘ðCñ ð ô
 ‰w‰~˜eÓ$Ð$r   r   r   r   N)r   r   c                ó.   — || _         || _        || _        y)a  Initialize a :class:`.RedditErrorItem` instance.

        :param error_type: The error type set on Reddit's end.
        :param field: The input field associated with the error, if available.
        :param message: The associated message for the error.

        Nr   )r   r   r   r   s       r   Ú__init__zRedditErrorItem.__init__+   s   € ð %ˆŒØˆŒØˆ�
r   c                 ó‚   — | j                   j                  › d| j                  ›d| j                  ›d| j                  ›d�S )z?Return an object initialization representation of the instance.z(error_type=z
, message=z, field=ú))r#   r   r   r   r   ©r   s    r   Ú__repr__zRedditErrorItem.__repr__>   sF   € ð �~‰~×&Ñ&Ð' |°D·O±OÐ3Fð GØŸ™Ð' x°·
±
¨~¸Qð@ð	
r   c                 ó   — | j                   S )z(Get the message returned from str(self).)r   r(   s    r   Ú__str__zRedditErrorItem.__str__E   s   € à×!Ñ!Ð!r   )r   r   r   r   ÚpropertyÚstrr   r   r   r"   r   r   r%   r)   r+   Ú__classcell__©r#   s   @r   r   r      s”   ø„ Ù?àð˜sò ó ðð%˜EÐ"3°T¸#±YÐ">Ñ?õ %ñ �\ 9¨gÓ6ð
  $Ø!%òàðð ˜‰}ð	ð
 ˜#‘òó 7ðð$
˜#ó 
ö"r   r   c                   ó   — e Zd ZdZy)ÚClientExceptionzEIndicate exceptions that don't involve interaction with Reddit's API.Nr   r   r   r   r1   r1   J   s   „ ÚOr   r1   c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚDuplicateReplaceExceptionzKIndicate exceptions that involve the replacement of :class:`.MoreComments`.c                 ó$   •— t         ‰| �  d«       y)z:Initialize a :class:`.DuplicateReplaceException` instance.ziA duplicate comment has been detected. Are you attempting to call 'replace_more_comments' more than once?N©r!   r%   ©r   r#   s    €r   r%   z"DuplicateReplaceException.__init__Q   s   ø€ ä‰Ñð7õ	
r   ©r   r   r   r   r%   r.   r/   s   @r   r3   r3   N   s   ø„ ÙU÷
ð 
r   r3   c                   ó(   ‡ — e Zd ZdZdefˆ fd„Zˆ xZS )ÚInvalidFlairTemplateIDz@Indicate exceptions where an invalid flair template ID is given.Útemplate_idc                 ó,   •— t         ‰| �  d|› d�«       y)z8Initialize an :class:`.InvalidFlairTemplateID` instance.zThe flair template ID 'zO' is invalid. If you are trying to create a flair, please use the 'add' method.Nr5   )r   r:   r#   s     €r   r%   zInvalidFlairTemplateID.__init__\   s!   ø€ ä‰ÑØ% k ]ð 3<ð <õ	
r   )r   r   r   r   r-   r%   r.   r/   s   @r   r9   r9   Y   s   ø„ ÙJð
 C÷ 
ñ 
r   r9   c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚInvalidImplicitAuthzDIndicate exceptions where an implicit auth type is used incorrectly.c                 ó$   •— t         ‰| �  d«       y)z5Initialize an :class:`.InvalidImplicitAuth` instance.z<Implicit authorization can only be used with installed apps.Nr5   r6   s    €r   r%   zInvalidImplicitAuth.__init__g   s   ø€ ä‰ÑÐWÕXr   r7   r/   s   @r   r=   r=   d   s   ø„ ÙN÷Yð Yr   r=   c                   óJ   ‡ — e Zd ZdZ edd«      ddœdedefˆ fd„«       Zˆ xZS )Ú
InvalidURLz4Indicate exceptions where an invalid URL is entered.Úurlr   zInvalid URL: {})r   c                óB   •— t         ‰| �  |j                  |«      «       y)zïInitialize an :class:`.InvalidURL` instance.

        :param url: The invalid URL.
        :param message: The message to display. Must contain a format identifier (``{}``
            or ``{0}``) (default: ``"Invalid URL: {}"``).

        N)r!   r%   Úformat)r   rA   r   r#   s      €r   r%   zInvalidURL.__init__o   s   ø€ ô 	‰Ñ˜Ÿ™¨Ó,Õ-r   )r   r   r   r   r   r-   r%   r.   r/   s   @r   r@   r@   l   s0   ø„ Ù>á�U˜IÓ&Ø3Dò .˜Cð .¨Sô .ó 'ô.r   r@   c                   ó   — e Zd ZdZy)Ú!MissingRequiredAttributeExceptionzAIndicate exceptions caused by not including a required attribute.Nr   r   r   r   rE   rE   {   s   „ ÚKr   rE   c                   ó   — e Zd ZdZy)ÚReadOnlyExceptionzJRaised when a method call requires :attr:`.read_only` mode to be disabled.Nr   r   r   r   rG   rG      s   „ ÚTr   rG   c                   óD   ‡ — e Zd ZdZ edd«      dedefˆ fd„«       Zˆ xZS )ÚTooLargeMediaExceptionz:Indicate exceptions from uploading media that's too large.Úmaximum_sizeÚactualc                óN   •— || _         || _        t        ‰| �  d|› d|› d�«       y)zÅInitialize a :class:`.TooLargeMediaException` instance.

        :param actual: The actual size of the uploaded media.
        :param maximum_size: The maximum size of the uploaded media.

        z;The media that you uploaded was too large (maximum size is z bytes, uploaded z bytes)N)rJ   rK   r!   r%   )r   rK   rJ   r#   s      €r   r%   zTooLargeMediaException.__init__†   s6   ø€ ð )ˆÔØˆŒÜ‰ÑØIÈ,ÈØ ˜x wð0õ	
r   )r   r   r   r   r   Úintr%   r.   r/   s   @r   rI   rI   ƒ   s-   ø„ ÙDá�^ XÓ.ð
 #ð 
°Sô 
ó /ô
r   rI   c                   ó–   ‡ — e Zd ZdZedefd„«       Zej                  defd„«       Zej                  d„ «       Zde	de
e   fˆ fd	„Zˆ xZS )
ÚWebSocketExceptionz0Indicate exceptions caused by use of WebSockets.r   c                 ó>   — t        dt        d¬«       | j                  S )z=Access the ``original_exception`` attribute (now deprecated).z°Accessing the attribute 'original_exception' is deprecated. Please rewrite your code in such a way that this attribute does not need to be used. It will be removed in PRAW 8.0.é   ©ÚcategoryÚ
stacklevel)r   ÚDeprecationWarningÚ_original_exceptionr(   s    r   Úoriginal_exceptionz%WebSocketException.original_exception™   s'   € ô 	ð,ô (Øõ	
ð ×'Ñ'Ð'r   Úvaluec                 ó   — || _         y ©N©rV   )r   rX   s     r   rW   z%WebSocketException.original_exception¥   s
   € à#(ˆÕ r   c                 ó   — | ` y rZ   r[   r(   s    r   rW   z%WebSocketException.original_exception©   s   € àÑ$r   r   Ú	exceptionc                 ó2   •— t         ‰| �  |«       || _        y)a  Initialize a :class:`.WebSocketException` instance.

        :param message: The exception message.
        :param exception: The exception thrown by the websocket library.

            .. note::

                This parameter is deprecated. It will be removed in PRAW 8.0.

        N)r!   r%   rV   )r   r   r]   r#   s      €r   r%   zWebSocketException.__init__­   s   ø€ ô 	‰Ñ˜Ô!Ø#,ˆÕ r   )r   r   r   r   r,   Ú	ExceptionrW   ÚsetterÚdeleterr-   r   r%   r.   r/   s   @r   rO   rO   –   sw   ø„ Ù:àð	( Iò 	(ó ð	(ð ×Ñð)¨	ò )ó ð)ð ×Ññ%ó  ð%ð- ð -°¸Ñ0C÷ -ñ -r   rO   c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚMediaPostFailedz0Indicate exceptions where media uploads failed..c                 ó&   •— t         ‰| �  dd«       y)z0Initialize a :class:`.MediaPostFailed` instance.z£The attempted media upload action has failed. Possible causes include the corruption of media files. Check that the media file can be opened on your local machine.Nr5   r6   s    €r   r%   zMediaPostFailed.__init__¿   s   ø€ ä‰Ñð#ð õ		
r   r7   r/   s   @r   rc   rc   ¼   s   ø„ Ù:÷
ð 
r   rc   c                   óÂ   ‡ — e Zd ZdZedeeeee   f      fd„«       Z	e
defd„«       Ze
defd„«       Ze
defd„«       Zdeeeeee   ef      ef   d	efˆ fd
„Zd„ Zˆ xZS )ÚAPIExceptionzÚOld class preserved for alias purposes.

    .. deprecated:: 7.0

        Class :class:`.APIException` has been deprecated in favor of
        :class:`.RedditAPIException`. This class will be removed in PRAW 8.0.

    Ú
exceptionsc                 óº   — | D �cg c]K  }t        |t        «      r|n6t        |d   t        |d   «      r|d   ndt        |d   «      r|d   nd¬«      ‘ŒM c}S c c}w )z?Covert an exception list into a :class:`.RedditErrorItem` list.r   rQ   Ú r   )r   r   r   )r    r   Úbool)rg   r]   s     r   Úparse_exception_listz!APIException.parse_exception_listÓ   sn   € ð (ö	
ð ô ˜)¤_Ô5ñ ä Ø$ Q™<Ü&*¨9°Q©<Ô&8�i ’l¸bÜ(,¨Y°q©\Ô(:˜	 !šÀôñò	
ð 		
ùò 	
s   …AAr   c                 ó$   — | j                  d«      S )aW  Get error_type.

        .. deprecated:: 7.0

            Accessing attributes through instances of :class:`.RedditAPIException` is
            deprecated. This behavior will be removed in PRAW 8.0. Check out the
            :ref:`PRAW 7 Migration tutorial <Exception_Handling>` on how to migrate code
            from this behavior.

        r   ©Ú_get_old_attrr(   s    r   r   zAPIException.error_typeá   s   € ð ×!Ñ! ,Ó/Ð/r   c                 ó$   — | j                  d«      S )aR  Get field.

        .. deprecated:: 7.0

            Accessing attributes through instances of :class:`.RedditAPIException` is
            deprecated. This behavior will be removed in PRAW 8.0. Check out the
            :ref:`PRAW 7 Migration tutorial <Exception_Handling>` on how to migrate code
            from this behavior.

        r   rm   r(   s    r   r   zAPIException.fieldï   s   € ð ×!Ñ! 'Ó*Ð*r   c                 ó$   — | j                  d«      S )aT  Get message.

        .. deprecated:: 7.0

            Accessing attributes through instances of :class:`.RedditAPIException` is
            deprecated. This behavior will be removed in PRAW 8.0. Check out the
            :ref:`PRAW 7 Migration tutorial <Exception_Handling>` on how to migrate code
            from this behavior.

        r   rm   r(   s    r   r   zAPIException.messageý   s   € ð ×!Ñ! )Ó,Ð,r   ÚitemsÚoptional_argsc                 óØ   •— t        |t        «      r|g|¢g}n&t        |t        «      rt        |d   t        «      r|g}| j                  |«      | _        t        ‰| �  | j                  Ž  y)a@  Initialize a :class:`.RedditAPIException` instance.

        :param items: Either a list of instances of :class:`.RedditErrorItem` or a list
            containing lists of unformed errors.
        :param optional_args: Takes the second and third arguments that
            :class:`.APIException` used to take.

        r   N)r    r-   Úlistrk   rq   r!   r%   )r   rq   rr   r#   s      €r   r%   zAPIException.__init__  s`   ø€ ô �eœSÔ!ØÐ,˜mÐ,Ð-‰EÜ˜œtÔ$¬°E¸!±H¼cÔ)BØ�GˆEØ×.Ñ.¨uÓ5ˆŒ
Ü‰Ñ˜$Ÿ*™*Ò%r   c                 ó`   — t        d|› d�t        d¬«       t        | j                  d   |«      S )NzAccessing attribute 'zÅ' through APIException is deprecated. This behavior will be removed in PRAW 8.0. Check out https://praw.readthedocs.io/en/latest/package_info/praw7_migration.html to learn how to migrate your code.é   rR   r   )r   rU   Úgetattrrq   )r   Úattrnames     r   rn   zAPIException._get_old_attr  s:   € ÜØ# H :ð .2ð 2ô (Øõ	
ô �t—z‘z !‘} hÓ/Ð/r   )r   r   r   r   Ústaticmethodr   r   r   r-   rk   r,   r   r   r   r%   rn   r.   r/   s   @r   rf   rf   É   sÂ   ø„ ñð ð
¨¨e°OÀTÈ#ÁYÐ4NÑ.OÑ)Pò 
ó ð
ð ð0˜Cò 0ó ð0ð ð+�sò +ó ð+ð ð-˜ò -ó ð-ð&à�T˜% °°c±¸CÐ ?Ñ@ÑAÀ3ÐFÑGð&ð õ&ö(	0r   rf   c                   ó   — e Zd ZdZy)ÚRedditAPIExceptionz/Container for error messages from Reddit's API.Nr   r   r   r   r{   r{   +  s   „ Ú9r   r{   N)r   Útypingr   r   r   Úwarningsr   Úutilr   r_   r
   r   r1   r3   r9   r=   r@   rE   rG   rI   rO   rc   rf   r{   r   r   r   ú<module>r      sÎ   ðñ÷ )Ñ (Ý å !ôK�Iô K÷3"ñ 3"ôlP�mô Pô
 ô 
ô
˜_ô 
ôY˜/ô Yô.�ô .ôL¨ô LôU˜ô Uô
˜_ô 
ô&#-˜ô #-ôL

Ð(ô 

ô_0�=ô _0ôD:˜õ :r   