
    ]*i                        d Z ddlmZ ddlmZm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)z&Exceptions raised by the BSON package.    )annotations)AnyOptionalc                      e Zd ZdZy)	BSONErrorz#Base class for all BSON exceptions.N__name__
__module____qualname____doc__     E/home/alumno/antonio/venv/lib/python3.12/site-packages/bson/errors.pyr   r      s    -r   r   c                      e Zd ZdZy)InvalidBSONz=Raised when trying to create a BSON object from invalid data.Nr   r   r   r   r   r      s    Gr   r   c                      e Zd ZdZy)InvalidStringDataz?Raised when trying to encode a string containing non-UTF8 data.Nr   r   r   r   r   r      s    Ir   r   c                  8     e Zd ZdZdd fdZedd       Z xZS )InvalidDocumentzDRaised when trying to create a BSON object from an invalid document.c                2    t         |   |       || _        y N)super__init__	_document)selfmessagedocument	__class__s      r   r   zInvalidDocument.__init__$   s    !!r   c                    | j                   S )zJThe invalid document that caused the error.

        ..versionadded:: 4.16)r   )r   s    r   r   zInvalidDocument.document(   s    
 ~~r   r   )r   strr   zOptional[Any]returnNone)r!   r   )r	   r
   r   r   r   propertyr   __classcell__)r   s   @r   r   r   !   s    N"  r   r   c                      e Zd ZdZy)	InvalidIdz;Raised when trying to create an ObjectId from invalid data.Nr   r   r   r   r&   r&   0   s    Er   r&   N)r   
__future__r   typingr   r   	Exceptionr   r   r   r   r&   r   r   r   <module>r*      sR    - "  .	 .H) HJ	 Ji F	 Fr   