
    &g7                       S r SSKJr  SSKJr  SSKJrJrJ	r	J
r
JrJrJr  SSKJr  \(       a  SSKJ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 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) jr& " S* S+\5      r' " S, S-\5      r( " S. S/\5      r) " S0 S1\5      r* " S2 S3\5      r+ " S4 S5\5      r, " S6 S7\5      r- " S8 S9\5      r. " S: S;\.5      r/ " S< S=\5      r0g>)AzExceptions raised by PyMongo.

.. seealso:: This module is compatible with both the synchronous and asynchronous PyMongo APIs.
    )annotations)SSLCertVerificationError)TYPE_CHECKINGAnyIterableMappingOptionalSequenceUnion)InvalidDocumentClientBulkWriteResult)_DocumentOutc                  f   ^  \ rS rSrSrS	S
U 4S jjjrSS jrSS jrSS jr\	SS j5       r
SrU =r$ )PyMongoError   z&Base class for all PyMongo exceptions.c                b   > [         TU ]  U5        Xl        [        U=(       d    / 5      U l        g N)super__init___messageset_error_labels)selfmessageerror_labels	__class__s      SC:\Suresh\moveshuttle\MDcreated\moveengine\venv\Lib\site-packages\pymongo/errors.pyr   PyMongoError.__init__"   s'    ! !34    c                    XR                   ;   $ )zKReturn True if this error contains the given label.

.. versionadded:: 3.7
)r   r   labels     r   has_error_labelPyMongoError.has_error_label'   s    
 ****r    c                :    U R                   R                  U5        g)z"Add the given label to this error.N)r   addr"   s     r   _add_error_labelPyMongoError._add_error_label.   s    u%r    c                :    U R                   R                  U5        g)z'Remove the given label from this error.N)r   discardr"   s     r   _remove_error_label PyMongoError._remove_error_label2   s    ""5)r    c                    g)zCTrue if this error was caused by a timeout.

.. versionadded:: 4.2
F r   s    r   timeoutPyMongoError.timeout6   s     r    )r   r    N)r   strr   zOptional[Iterable[str]]returnNone)r#   r5   r6   bool)r#   r5   r6   r7   r6   r8   )__name__
__module____qualname____firstlineno____doc__r   r$   r(   r,   propertyr1   __static_attributes____classcell__r   s   @r   r   r      s3    05 5
+&*  r    r   c                      \ rS rSrSrSrg)ProtocolError?   z1Raised for failures related to the wire protocol.r/   Nr:   r;   r<   r=   r>   r@   r/   r    r   rD   rD   ?   s    ;r    rD   c                      \ rS rSrSrSrg)ConnectionFailureC   zCRaised when a connection to the database cannot be made or is lost.r/   NrF   r/   r    r   rH   rH   C       Mr    rH   c                  ,    \ rS rSrSr\SS j5       rSrg)WaitQueueTimeoutErrorG   zRaised when an operation times out waiting to checkout a connection from the pool.

Subclass of :exc:`~pymongo.errors.ConnectionFailure`.

.. versionadded:: 4.2
c                    gNTr/   r0   s    r   r1   WaitQueueTimeoutError.timeoutO       r    r/   Nr9   r:   r;   r<   r=   r>   r?   r1   r@   r/   r    r   rL   rL   G   s      r    rL   c                  V   ^  \ rS rSr% SrS\S'   S\S'    S     S	U 4S jjjrSrU =r$ )
AutoReconnectT   a  Raised when a connection to the database is lost and an attempt to
auto-reconnect will be made.

In order to auto-reconnect you must handle this exception, recognizing that
the operation which caused it has not necessarily succeeded. Future
operations will attempt to open a new connection to the database (and
will continue to raise this exception until the first successful
connection is made).

Subclass of :exc:`~pymongo.errors.ConnectionFailure`.
z'Union[Mapping[str, Any], Sequence[Any]]errorsdetailsc                   > S nUb&  [        U[        5      (       a  UR                  S5      n[        TU ]  X5        U=(       d    / =U l        U l        g )NerrorLabels)
isinstancedictgetr   r   rV   rW   )r   r   rV   r   r   s       r   r   AutoReconnect.__init__d   sJ     &$''%zz-8/%+\r1dlr    )rW   rV   r3   )r   r5   rV   z1Optional[Union[Mapping[str, Any], Sequence[Any]]]r6   r7   )	r:   r;   r<   r=   r>   __annotations__r   r@   rA   rB   s   @r   rT   rT   T   s?    
 4344 ^b22)Z2	2 2r    rT   c                  ,    \ rS rSrSr\SS j5       rSrg)NetworkTimeouto   zAn operation on an open connection exceeded socketTimeoutMS.

The remaining connections in the pool stay open. In the case of a write
operation, you cannot know whether it succeeded or failed.

Subclass of :exc:`~pymongo.errors.AutoReconnect`.
c                    grO   r/   r0   s    r   r1   NetworkTimeout.timeoutx   rQ   r    r/   Nr9   rR   r/   r    r   r`   r`   o         r    r`   c                    Ub  U  SU 3n U $ )Nz, full error: r/   )r   rW   s     r   _format_detailed_errorrf   }   s     I^G95Nr    c                  @   ^  \ rS rSrSr S     SU 4S jjjrSrU =r$ )NotPrimaryError   a&  The server responded "not primary" or "node is recovering".

These errors result from a query, write, or command. The operation failed
because the client thought it was using the primary but the primary has
stepped down, or the client thought it was using a healthy secondary but
the secondary is stale and trying to recover.

The client launches a refresh operation on a background thread, to update
its view of the server as soon as possible after throwing this exception.

Subclass of :exc:`~pymongo.errors.AutoReconnect`.

.. versionadded:: 3.12
c                4   > [         TU ]  [        X5      US9  g )N)rV   )r   r   rf   )r   r   rV   r   s      r   r   NotPrimaryError.__init__   s     	/@Pr    r/   r3   )r   r5   rV   -Optional[Union[Mapping[str, Any], list[Any]]]r6   r7   )r:   r;   r<   r=   r>   r   r@   rA   rB   s   @r   rh   rh      s6      Z^QQ)VQ	Q Qr    rh   c                  ,    \ rS rSrSr\SS j5       rSrg)ServerSelectionTimeoutError   a	  Thrown when no MongoDB server is available for an operation

If there is no suitable server for an operation PyMongo tries for
``serverSelectionTimeoutMS`` (default 30 seconds) to find one, then
throws this exception. For example, it is thrown after attempting an
operation when PyMongo cannot connect to any server, or if you attempt
an insert into a replica set that has no primary and does not elect one
within the timeout window, or if you attempt to query with a Read
Preference that the replica set cannot satisfy.
c                    grO   r/   r0   s    r   r1   #ServerSelectionTimeoutError.timeout   rQ   r    r/   Nr9   rR   r/   r    r   rn   rn      s    	  r    rn   c                      \ rS rSrSrSrg)ConfigurationError   z0Raised when something is incorrectly configured.r/   NrF   r/   r    r   rs   rs      s    :r    rs   c                     ^  \ rS rSrSr   S	         S
U 4S jjjr\SS j5       r\SS j5       r\SS j5       r	\SS j5       r
SrU =r$ )OperationFailure   zaRaised when a database operation fails.

.. versionadded:: 2.7
   The :attr:`details` attribute.
c                   > S nUb  UR                  S5      n[        TU ]	  [        X5      US9  X l        X0l        X@l        g )NrY   )r   )r\   r   r   rf   _OperationFailure__code_OperationFailure__details#_OperationFailure__max_wire_version)r   errorcoderW   max_wire_versionr   r   s         r   r   OperationFailure.__init__   sF     ";;}5L/?l[ "2r    c                    U R                   $ r   )r{   r0   s    r   _max_wire_version"OperationFailure._max_wire_version   s    &&&r    c                    U R                   $ )z.The error code returned by the server, if any.ry   r0   s    r   r}   OperationFailure.code   s     {{r    c                    U R                   $ )a&  The complete error document returned by the server.

Depending on the error that occurred, the error document
may include useful information beyond just the error
message. When connected to a mongos the error document
may contain one or more subdocuments if errors occurred
on multiple shards.
)rz   r0   s    r   rW   OperationFailure.details   s     ~~r    c                     U R                   S;   $ )N)2   r   r0   s    r   r1   OperationFailure.timeout   s    {{e##r    )__code	__details__max_wire_version)NNN)
r|   r5   r}   Optional[int]rW   Optional[Mapping[str, Any]]r~   r   r6   r7   )r6   r   )r6   r   r9   )r:   r;   r<   r=   r>   r   r?   r   r}   rW   r1   r@   rA   rB   s   @r   rv   rv      s     #/3*.33 3 -	3
 (3 
3 3 ' '   	 	 $ $r    rv   c                      \ rS rSrSrSrg)CursorNotFound   zhRaised while iterating query results if the cursor is
invalidated on the server.

.. versionadded:: 2.7
r/   NrF   r/   r    r   r   r      s    r    r   c                  ,    \ rS rSrSr\SS j5       rSrg)ExecutionTimeout   zRaised when a database operation times out, exceeding the $maxTimeMS
set in the query or command option.

.. note:: Requires server version **>= 2.6.0**

.. versionadded:: 2.7
c                    grO   r/   r0   s    r   r1   ExecutionTimeout.timeout   rQ   r    r/   Nr9   rR   r/   r    r   r   r      rd   r    r   c                      \ rS rSrSrSrg)WriteConcernError   zSBase exception type for errors raised due to write concern.

.. versionadded:: 3.0
r/   NrF   r/   r    r   r   r          r    r   c                      \ rS rSrSrSrg)
WriteError   zVBase exception type for errors raised during write operations.

.. versionadded:: 3.0
r/   NrF   r/   r    r   r   r      r   r    r   c                  ,    \ rS rSrSr\SS j5       rSrg)WTimeoutErrori  zRaised when a database operation times out (i.e. wtimeout expires)
before replication completes.

With newer versions of MongoDB the `details` attribute may include
write concern fields like 'n', 'updatedExisting', or 'writtenTo'.

.. versionadded:: 2.7
c                    grO   r/   r0   s    r   r1   WTimeoutError.timeout  rQ   r    r/   Nr9   rR   r/   r    r   r   r     s      r    r   c                      \ rS rSrSrSrg)DuplicateKeyErrori  zCRaised when an insert or update fails due to a duplicate key error.r/   NrF   r/   r    r   r   r     rJ   r    r   c                x    U R                  S5      S:H  =(       d     SU ;   =(       a    U S   R                  S5      $ )zCReturn True if this writeConcernError doc is a caused by a timeout.r}   r   errInfowtimeout)r\   )r|   s    r   _wtimeout_errorr     s6    99V"_yE'9'^eI>N>R>RS]>^_r    c                  Z   ^  \ rS rSr% SrS\S'   S	U 4S jjrS
S jr\SS j5       r	Sr
U =r$ )BulkWriteErrori  z>Exception class for bulk write errors.

.. versionadded:: 2.7
r   rW   c                (   > [         TU ]  SSU5        g Nzbatch op errors occurredA   )r   r   )r   resultsr   s     r   r   BulkWriteError.__init__$  s    3RAr    c                4    U R                   U R                  44$ r   r   rW   r0   s    r   
__reduce__BulkWriteError.__reduce__'      ~~..r    c                    U R                   R                  S/ 5      nU(       a  [        US   5      (       a  gU R                   R                  S/ 5      nU(       a  US   R                  S5      S:X  a  gg)NwriteConcernErrorsTwriteErrorsr}   r   F)rW   r\   r   )r   wceswerrss      r   r1   BulkWriteError.timeout*  sb     || 4b9ODH--  3U2Y]]6*b0r    r/   )r   r   r6   r7   r6   ztuple[Any, Any]r9   )r:   r;   r<   r=   r>   r^   r   r   r?   r1   r@   rA   rB   s   @r   r   r     s/    
 B/ 
 
r    r   c                     ^  \ rS rSr% SrS\S'   S\S'   SU 4S jjrSS jr\SS	 j5       r	\SS
 j5       r
\SS j5       r\SS j5       rSrU =r$ )ClientBulkWriteExceptioni8  z3Exception class for client-level bulk write errors.r   rW   r8   verbosec                4   > [         TU ]  SSU5        X l        g r   )r   r   r   )r   r   r   r   s      r   r   !ClientBulkWriteException.__init__>  s    3RAr    c                4    U R                   U R                  44$ r   r   r0   s    r   r   #ClientBulkWriteException.__reduce__B  r   r    c                :    U R                   R                  SS5      $ )zA top-level error that occurred when attempting to
communicate with the server or execute the bulk write.

This value may not be populated if the exception was
thrown due to errors occurring on individual writes.
r|   NrW   r\   r0   s    r   r|   ClientBulkWriteException.errorE  s     ||..r    c                :    U R                   R                  S/ 5      $ )zWrite concern errors that occurred during the bulk write.

This list may have multiple items if more than one
server command was required to execute the bulk write.
r   r   r0   s    r   write_concern_errors-ClientBulkWriteException.write_concern_errorsO  s     || 4b99r    c                :    U R                   R                  S0 5      $ )zErrors that occurred during the execution of individual write operations.

This list will contain at most one entry if the bulk write was ordered.
r   r   r0   s    r   write_errors%ClientBulkWriteException.write_errorsX  s     ||r22r    c                    SSK Jn  U R                  R                  S5      (       a  U" U R                  SU R                  S9$ g)z_The results of any successful operations that were
performed before the error was encountered.
r   r   anySuccessfulT)acknowledgedhas_verbose_resultsN)pymongo.resultsr   rW   r\   r   )r   r   s     r   partial_result'ClientBulkWriteException.partial_result`  s?    
 	:<<O,,(!$(LL 
 r    )r   )r   r   r   r8   r6   r7   r   )r6   zOptional[Any])r6   z!Optional[list[WriteConcernError]])r6   zOptional[list[WriteError]])r6   zOptional[ClientBulkWriteResult])r:   r;   r<   r=   r>   r^   r   r   r?   r|   r   r   r   r@   rA   rB   s   @r   r   r   8  sk    =M/ / / : : 3 3  r    r   c                      \ rS rSrSrSrg)InvalidOperationip  z>Raised when a client attempts to perform an invalid operation.r/   NrF   r/   r    r   r   r   p  s    Hr    r   c                      \ rS rSrSrSrg)InvalidNameit  z$Raised when an invalid name is used.r/   NrF   r/   r    r   r   r   t  s    .r    r   c                      \ rS rSrSrSrg)CollectionInvalidix  z(Raised when collection validation fails.r/   NrF   r/   r    r   r   r   x  s    2r    r   c                      \ rS rSrSrSrg)
InvalidURIi|  z3Raised when trying to parse an invalid mongodb URI.r/   NrF   r/   r    r   r   r   |  s    =r    r   c                      \ rS rSrSrSrg)DocumentTooLargei  zFRaised when an encoded document is too large for the connected server.r/   NrF   r/   r    r   r   r     s    Pr    r   c                  X   ^  \ rS rSrSrSU 4S jjr\SS j5       r\S	S j5       rSr	U =r
$ )
EncryptionErrori  zRaised when encryption or decryption fails.

This error always wraps another exception which can be retrieved via the
:attr:`cause` property.

.. versionadded:: 3.9
c                B   > [         TU ]  [        U5      5        Xl        g r   )r   r   r5   _EncryptionError__cause)r   causer   s     r   r   EncryptionError.__init__  s    U$r    c                    U R                   $ )z>The exception that caused this encryption or decryption error.)r   r0   s    r   r   EncryptionError.cause  s     ||r    c                n    [        U R                  [        5      (       a  U R                  R                  $ g)NF)rZ   r   r   r1   r0   s    r   r1   EncryptionError.timeout  s&    dllL11<<'''r    )__cause)r   	Exceptionr6   r7   )r6   r   r9   )r:   r;   r<   r=   r>   r   r?   r   r1   r@   rA   rB   s   @r   r   r     s5        r    r   c                  D   ^  \ rS rSrSrSU 4S jjr\SS j5       rSrU =r	$ )EncryptedCollectionErrori  zVRaised when creating a collection with encrypted_fields fails.

.. versionadded:: 4.4
c                0   > [         TU ]  U5        X l        g r   )r   r   +_EncryptedCollectionError__encrypted_fields)r   r   encrypted_fieldsr   s      r   r   !EncryptedCollectionError.__init__  s    "2r    c                    U R                   $ )a  The encrypted_fields document that allows inferring which data keys are *known* to be created.

Note that the returned document is not guaranteed to contain information about *all* of the data keys that
were created, for example in the case of an indefinite error like a timeout. Use the `cause` property to
determine whether a definite or indefinite error caused this error, and only rely on the accuracy of the
encrypted_fields if the error is definite.
)r   r0   s    r   r   )EncryptedCollectionError.encrypted_fields  s     &&&r    )__encrypted_fields)r   r   r   Mapping[str, Any]r6   r7   )r6   r   )
r:   r;   r<   r=   r>   r   r?   r   r@   rA   rB   s   @r   r   r     s!    
3 ' 'r    r   c                      \ rS rSrSrSrg)_OperationCancelledi  z;Internal error raised when a socket operation is cancelled.r/   NrF   r/   r    r   r   r     s    Er    r   N)r   r5   rW   rl   r6   r5   )r|   r   r6   r8   )1r>   
__future__r   sslr   _CertificateErrortypingr   r   r   r   r	   r
   r   bson.errorsr   r   r   pymongo.typingsr   r   r   rD   rH   rL   rT   r`   rf   rh   rn   rs   rv   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r/   r    r   <module>r      s   # = S S S '5,9 @<L <N N
- 
2% 26] HQm Q,- "; ;-$| -$`% ' ( ! % N
 N`
% 85/ 5pI| I/, /3 3># >Q Ql 2' ',F- Fr    