
    i                        S r SSKrSSKrSSKJr  SSKr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.rSSS.S\\   S\S\\R.                     S \\   S!S4
S" jjrg)#z&
Exceptions raised in :mod:`aioqbt`.

    N)Optional)Selfc                       \ rS rSrSrSrg)AQError   z
Generic error class.
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r       7/app/mltbenv/lib/python3.13/site-packages/aioqbt/exc.pyr   r          r   r   c                       \ rS rSrSrSrg)MapperError   z'
Raised when mapper operations failed.
r   Nr	   r   r   r   r   r      r   r   r   c                       \ rS rSrSrSrg)VersionError   z
Version check failed.
r   Nr	   r   r   r   r   r      r   r   r   c                       \ rS rSr% Sr\\S'    \\S'    \\	R                     \S'       SS\S\S\\	R                     4S jjr\ SS\	R                  S\S\4S	 jj5       rS\4S
 jrS\4S jrSrg)APIError    z
Base class of API errors.
messagestatusrespNc                 (    Xl         X l        X0l        g Nr   r   r   )selfr   r   r   s       r   __init__APIError.__init__.   s     	r   returnc                 ^    U " U=(       d    [        UR                  5      UR                  US9$ )z1Create an exception instance based on a response.r!   )strreasonr   )clsr   r   s      r   from_responseAPIError.from_response8   s,     /s4;;/;;
 	
r   c                 j    [        U 5      R                   SU R                  < SU R                  < S3$ )Nz(status=z
, message=))typer
   r   r   r"   s    r   __repr__APIError.__repr__F   s0    t*%%&ht{{oZGWWXYYr   c                     [        U 5      $ r    )reprr/   s    r   __str__APIError.__str__I   s    Dzr   )r   r   r   ) r   N)r6   )r
   r   r   r   r   r'   __annotations__intr   aiohttpClientResponser#   classmethodr   r*   r0   r4   r   r   r   r   r   r       s     L-K
7))
**$ 15	  w--.	  
$$
 
 
	
 
Z# Z r   r   c                       \ rS rSrSrSrg)
LoginErrorM   zU
Login has failed.

This is raised by :meth:`.AuthAPI.login` and HTTP status is 200.
r   Nr	   r   r   r   r=   r=   M       r   r=   c                       \ rS rSrSrSrg)AddTorrentErrorU   ze
No **new** torrents were added.

This is raised by :meth:`.TorrentsAPI.add` and HTTP status is 200.
r   Nr	   r   r   r   rA   rA   U   r?   r   rA   c                       \ rS rSrSrSrg)BadRequestError]   z
Bad request.

The error is usually raised because of missing or invalid parameters.
This may be caused by empty value sometimes.

HTTP status is usually 400.
r   Nr	   r   r   r   rD   rD   ]   s    r   rD   c                       \ rS rSrSrSrg)ForbiddenErrorh   zk
Forbidden.

The request to resources is explicitly denied due to permission.

HTTP status is usually 403.
r   Nr	   r   r   r   rG   rG   h       r   rG   c                       \ rS rSrSrSrg)NotFoundErrorr   zz
Not found.

It is likely that the API endpoint is misspelled or qBittorrent need an update.

HTTP status is usually 404.
r   Nr	   r   r   r   rK   rK   r   rI   r   rK   c                       \ rS rSrSrSrg)ConflictError|   z(
Conflict.

HTTP status is usually 409.
r   Nr	   r   r   r   rN   rN   |   r?   r   rN   c                       \ rS rSrSrSrg)UnsupportedMediaTypeError   z6
Unsupported media type.

HTTP status is usually 415.
r   Nr	   r   r   r   rQ   rQ      r?   r   rQ   )i  i  i  i  i  )logger	log_levelexnoterS   rT   r%   c                    [         R                  S:  a  U R                  U5        gUc  [        R                  " [
         S35      nUc  [        R                  nUR                  X1U S9  g)zI
Add a note to exception if Python version >= 3.11 or record with logger
)      Nz.note)exc_info)sysversion_infoadd_notelogging	getLoggerr
   WARNINGlog)rU   rV   rS   rT   s       r   	_add_noterb      s^     7"
D ~""hZu#56OO	
JJyJ,r   )r   r^   r[   typingr   r9   typing_extensionsr   	Exceptionr   r   r   r   r=   rA   rD   rG   rK   rN   rQ   _ERROR_TABLEBaseExceptionr'   Loggerr8   rb   r   r   r   <module>ri      s  
  
   "i ' 7 *w *Z h h X H H   
				" (,#--
- W^^$	-
 }- 
-r   