
    gJ                     D    S SK r S SKJr   " S S\5      r " S S\5      rg)    N)Optionalc                       \ rS rSrSrg)TwilioException    N)__name__
__module____qualname____firstlineno____static_attributes__r       ^/Users/Alptekin/Desktop/izin_takip/venv/lib/python3.13/site-packages/twilio/base/exceptions.pyr   r      s    r   r   c                   `    \ rS rSrSr    SS\S\S\S\\   S\S	\\   4S
 jjr	S\4S jr
Srg)TwilioRestException
   a  A generic 400 or 500 level exception from the Twilio API

:param int status: the HTTP status that was returned for the exception
:param str uri: The URI that caused the exception
:param str msg: A human-readable message for the error
:param int|None code: A Twilio-specific error code for the error. This is
     not available for all errors.
:param method: The HTTP method used to make the request
:param details: Additional error details returned for the exception
Nstatusurimsgcodemethoddetailsc                 L    X l         Xl        X0l        X@l        XPl        X`l        g )N)r   r   r   r   r   r   )selfr   r   r   r   r   r   s          r   __init__TwilioRestException.__init__   s"     	r   returnc                    S[         S[         4S jnS[         S[         4S jnS[         S[         4S jnS[         S[         4S jnS[        S[         4S jn[        [        R                  S	5      (       a  [        R                  R                  5       (       a  S
R                  U" S5      U" S5      U" U R                  < SU R                  < 35      U" S5      U" [        U R                  5      5      S9nU R                  (       a=  SR                  USR                  U" S5      U" U" U R                  5      5      S9/5      nU$ SR                  U R                  U R                  5      $ )z>Try to pretty-print the exception, if this is going on screen.wordsr   c                     SU -  $ )Nz[31m[49m%s[0mr   r   s    r   red(TwilioRestException.__str__.<locals>.red)       .66r   c                     SU -  $ )Nz[37m[49m%s[0mr   r    s    r   white*TwilioRestException.__str__.<locals>.white,   r#   r   c                     SU -  $ )Nz[34m[49m%s[0mr   r    s    r   blue)TwilioRestException.__str__.<locals>.blue/   r#   r   c                     SU -  $ )Nz[36m[49m%s[0mr   r    s    r   teal)TwilioRestException.__str__.<locals>.teal2   r#   r   r   c                 $    SR                  U 5      $ )Nz&https://www.twilio.com/docs/errors/{0})format)r   s    r   get_uri,TwilioRestException.__str__.<locals>.get_uri5   s    ;BB4HHr   isattyzF
{red_error} {request_was}

{http_line}

{twilio_returned}

{message}
z
HTTP ErrorzYour request was: z*Twilio returned the following information:)	red_errorrequest_was	http_linetwilio_returnedmessage z
{more_info}

{uri}

z'More information may be available here:)	more_infor   zHTTP {0} error: {1})strinthasattrsysstderrr1   r.   r   r   r   r   joinr   )r   r!   r%   r(   r+   r/   r   s          r   __str__TwilioRestException.__str__&   sO   	7s 	7s 	7	7 	7 	7	7 	7 	7	7 	7 	7	I# 	I# 	I 3::x((SZZ->->-@-@77=v!,/ %&9 :"dkk488#DE$)*V$W TXX/ 8> 8  yygg4;;&+,U&V $WTYY%7 8 <  J(//TXXFFr   )r   r   r   r   r   r   )r8   NGETN)r   r	   r
   r   __doc__r;   r:   r   objectr   r@   r   r   r   r   r   r   
   sk    	 "$(  	
 sm  &! ,G ,Gr   r   )r=   typingr   	Exceptionr   r   r   r   r   <module>rG      s'    
 	i 	HG/ HGr   