
    >id&                        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 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/ d0e      Z G d1 d2e      Z G d3 d4e      Z G d5 d6e      Z G d7 d8e      Z G d9 d:e      Z G d; d<e      Z G d= d>e      Z  G d? d@e      Z! G dA dBe      Z" G dC dDe      Z# G dE dFe      Z$ G dG dHe$      Z% G dI dJe$      Z& G dK dLe$      Z' G dM dNe$      Z( G dO dPe$      Z) G dQ dRe$      Z* G dS dTe$      Z+ G dU dVe      Z, G dW dXe,      Z- G dY dZe      Z. G d[ d\e      Z/ G d] d^e      Z0 G d_ d`e      Z1 G da dbe      Z2 G dc dde2      Z3 G de dfe2      Z4 G dg dhe      Z5 G di dje5      Z6 G dk dle      Z7 G dm dne      Z8yo)pa  
Pydoll Exception Classes

This module contains all exception classes used throughout the Pydoll library,
organized into logical categories based on their function and usage patterns.
Each category uses a base class to provide common functionality for related exceptions.
c                   (    e Zd ZdZdZddefdZd Zy)PydollExceptionz%Base class for all Pydoll exceptions.zAn error occurred in Pydollmessagec                 .    |xs | j                   | _         y Nr   )selfr   s     W/var/www/python/tenders/Scrapper/venv/lib/python3.12/site-packages/pydoll/exceptions.py__init__zPydollException.__init__   s    .$,,    c                     | j                   S r   r   )r   s    r	   __str__zPydollException.__str__   s    ||r   N) )__name__
__module____qualname____doc__r   strr
   r    r   r	   r   r   
   s    /+G/ /r   r   c                       e Zd ZdZdZy)ConnectionExceptionz8Base class for exceptions related to browser connection.zA connection error occurredNr   r   r   r   r   r   r   r	   r   r      s
    B+Gr   r   c                       e Zd ZdZdZy)ConnectionFailedz<Raised when connection to the browser cannot be established.z Failed to connect to the browserNr   r   r   r	   r   r      s
    F0Gr   r   c                       e Zd ZdZdZy)ReconnectionFailedz9Raised when an attempt to reconnect to the browser fails.z"Failed to reconnect to the browserNr   r   r   r	   r   r   "   s
    C2Gr   r   c                       e Zd ZdZdZy)WebSocketConnectionClosedzKRaised when the WebSocket connection to the browser is closed unexpectedly.z"The WebSocket connection is closedNr   r   r   r	   r   r   (   s
    U2Gr   r   c                       e Zd ZdZdZy)NetworkErrorzHRaised when a general network error occurs during browser communication.zA network error occurredNr   r   r   r	   r   r   .   s
    R(Gr   r   c                       e Zd ZdZdZy)BrowserExceptionz@Base class for exceptions related to browser process management.zA browser error occurredNr   r   r   r	   r!   r!   4   s
    J(Gr   r!   c                       e Zd ZdZdZy)BrowserNotRunningzFRaised when attempting to interact with a browser that is not running.zThe browser is not runningNr   r   r   r	   r#   r#   :   s
    P*Gr   r#   c                       e Zd ZdZdZy)FailedToStartBrowserz2Raised when the browser process cannot be started.zFailed to start the browserNr   r   r   r	   r%   r%   @   s
    <+Gr   r%   c                       e Zd ZdZdZy)UnsupportedOSzARaised when attempting to run on an unsupported operating system.zUnsupported OSNr   r   r   r	   r'   r'   F   s
    KGr   r'   c                       e Zd ZdZdZy)NoValidTabFoundz9Raised when no valid browser tab can be found or created.zNo valid attached tab foundNr   r   r   r	   r)   r)   L   s
    C+Gr   r)   c                       e Zd ZdZdZy)InvalidConnectionPortzBRaised when an invalid (non-positive) connection port is provided.z*Connection port must be a positive integerNr   r   r   r	   r+   r+   R   s
    L:Gr   r+   c                       e Zd ZdZdZy)InvalidWebSocketAddresszMRaised when an invalid WebSocket address is provided or required but missing.zInvalid WebSocket addressNr   r   r   r	   r-   r-   X   s
    W)Gr   r-   c                       e Zd ZdZdZy)MissingTargetOrWebSocketzHRaised when a Tab has neither target ID nor WebSocket address available.z)Tab has no target ID or WebSocket addressNr   r   r   r	   r/   r/   ^   s
    R9Gr   r/   c                       e Zd ZdZdZy)ProtocolExceptionz@Base class for exceptions related to CDP protocol communication.zA protocol error occurredNr   r   r   r	   r1   r1   d   
    J)Gr   r1   c                       e Zd ZdZdZy)TopLevelTargetRequiredz@Raised when a command can only be executed on top-level targets.z2Command can only be executed on top-level targets.Nr   r   r   r	   r4   r4   j   s
    JBGr   r4   c                       e Zd ZdZdZy)InvalidCommandz6Raised when an invalid command is sent to the browser.zThe command provided is invalidNr   r   r   r	   r6   r6   p   s
    @/Gr   r6   c                       e Zd ZdZdZy)InvalidResponsez=Raised when an invalid response is received from the browser.z The response received is invalidNr   r   r   r	   r8   r8   v   s
    G0Gr   r8   c                       e Zd ZdZdZy)ResendCommandFailedz8Raised when an attempt to resend a failed command fails.zFailed to resend the commandNr   r   r   r	   r:   r:   |   s
    B,Gr   r:   c                       e Zd ZdZdZy)CommandExecutionTimeoutz*Raised when a command execution times out.zThe command execution timed outNr   r   r   r	   r<   r<      s
    4/Gr   r<   c                       e Zd ZdZdZy)InvalidCallbackz9Raised when an invalid callback is provided for an event.z The callback provided is invalidNr   r   r   r	   r>   r>      s
    C0Gr   r>   c                       e Zd ZdZdZy)EventNotSupportedzDRaised when an attempt is made to subscribe to an unsupported event.zThe event is not supportedNr   r   r   r	   r@   r@      s
    N*Gr   r@   c                       e Zd ZdZdZy)ElementExceptionz:Base class for exceptions related to element interactions.z%An element interaction error occurredNr   r   r   r	   rB   rB      s
    D5Gr   rB   c                       e Zd ZdZdZy)ElementNotFoundz2Raised when an element cannot be found in the DOM.z#The specified element was not foundNr   r   r   r	   rD   rD      s
    <3Gr   rD   c                       e Zd ZdZdZy)ElementNotVisiblezGRaised when attempting to interact with an element that is not visible.zThe element is not visibleNr   r   r   r	   rF   rF      s
    Q*Gr   rF   c                       e Zd ZdZdZy)ElementNotInteractablezSRaised when attempting to interact with an element that cannot receive interaction.zThe element is not interactableNr   r   r   r	   rH   rH      s
    ]/Gr   rH   c                       e Zd ZdZdZy)ClickInterceptedz@Raised when a click operation is intercepted by another element.zThe click was interceptedNr   r   r   r	   rJ   rJ      r2   r   rJ   c                       e Zd ZdZdZy)ElementNotAFileInputzMRaised when attempting to use file input methods on a non-file input element.zThe element is not a file inputNr   r   r   r	   rL   rL      s
    W/Gr   rL   c                       e Zd ZdZdZy)ShadowRootNotFoundz=Raised when an element does not have an attached shadow root.z'No shadow root attached to this elementNr   r   r   r	   rN   rN      s
    G7Gr   rN   c                       e Zd ZdZdZy)TimeoutExceptionz.Base class for exceptions related to timeouts.zA timeout occurredNr   r   r   r	   rP   rP      s
    8"Gr   rP   c                       e Zd ZdZdZy)PageLoadTimeoutz,Raised when a page load operation times out.zPage load timed outNr   r   r   r	   rR   rR      s
    6#Gr   rR   c                       e Zd ZdZdZy)WaitElementTimeoutz-Raised when waiting for an element times out.z'Timed out waiting for element to appearNr   r   r   r	   rT   rT      s
    77Gr   rT   c                       e Zd ZdZdZy)DownloadTimeoutz>Raised when waiting for a file download to complete times out.z*Timed out waiting for download to completeNr   r   r   r	   rV   rV      s
    H:Gr   rV   c                   ,     e Zd ZdZdedef fdZ xZS )NavigationErrorzARaised when page navigation fails (e.g., DNS resolution failure).url
error_textc                 N    || _         || _        t        |   d| d|        y )NzNavigation to z	 failed: r   )rY   rZ   superr
   )r   rY   rZ   	__class__s      r	   r
   zNavigationError.__init__   s3    $$SE:,? 	 	
r   )r   r   r   r   r   r
   __classcell__)r]   s   @r	   rX   rX      s    K
C 
S 
 
r   rX   c                       e Zd ZdZdZy)ConfigurationExceptionz?Base class for exceptions related to configuration and options.zA configuration error occurredNr   r   r   r	   r`   r`      s
    I.Gr   r`   c                       e Zd ZdZdZy)InvalidOptionsObjectz2Raised when an invalid options object is provided.z&The options object provided is invalidNr   r   r   r	   rb   rb      s
    <6Gr   rb   c                       e Zd ZdZdZy)InvalidBrowserPathz;Raised when an invalid browser executable path is provided.z$The browser path provided is invalidNr   r   r   r	   rd   rd      s
    E4Gr   rd   c                       e Zd ZdZdZy)ArgumentAlreadyExistsInOptionszFRaised when attempting to add a duplicate argument to browser options.z*The argument already exists in the optionsNr   r   r   r	   rf   rf      s
    P:Gr   rf   c                       e Zd ZdZdZy)ArgumentNotFoundInOptionszTRaised when attempting to remove an argument that does not exist in browser options.z*The argument does not exist in the optionsNr   r   r   r	   rh   rh      s
    ^:Gr   rh   c                       e Zd ZdZdZy)InvalidFileExtensionz6Raised when an unsupported file extension is provided.z,The file extension provided is not supportedNr   r   r   r	   rj   rj      s
    @<Gr   rj   c                       e Zd ZdZdZy)InvalidTabInitializationzLRaised when creating a Tab without connection_port, target_id or ws_address.zAEither connection_port, target_id, or ws_address must be providedNr   r   r   r	   rl   rl     s
    VQGr   rl   c                       e Zd ZdZdZy)MissingScreenshotPathzLRaised when take_screenshot is called without path and not returning base64.z(path is required when as_base64 is FalseNr   r   r   r	   rn   rn     s
    V8Gr   rn   c                       e Zd ZdZdZy)DialogExceptionz5Base class for exceptions related to browser dialogs.zA dialog error occurredNr   r   r   r	   rp   rp     s
    ?'Gr   rp   c                       e Zd ZdZdZy)NoDialogPresentzDRaised when attempting to interact with a dialog that doesn't exist.zNo dialog present on the pageNr   r   r   r	   rr   rr     s
    N-Gr   rr   c                       e Zd ZdZdZy)NotAnIFramez(Raised when an element is not an iframe.zThe element is not an iframeNr   r   r   r	   rt   rt     s
    2,Gr   rt   c                       e Zd ZdZdZy)InvalidIFramez#Raised when an iframe is not valid.zThe iframe is not validNr   r   r   r	   rv   rv   #  s
    -'Gr   rv   c                       e Zd ZdZdZy)IFrameNotFoundz#Raised when an iframe is not found.zThe iframe was not foundNr   r   r   r	   rx   rx   )  s
    -(Gr   rx   c                       e Zd ZdZdZy)NetworkEventsNotEnabledz+Raised when network events are not enabled.zNetwork events not enabledNr   r   r   r	   rz   rz   /  s
    5*Gr   rz   c                       e Zd ZdZdZy)RequestExceptionz3Base class for exceptions related to HTTP requests.zAn HTTP request error occurredNr   r   r   r	   r|   r|   5  s
    =.Gr   r|   c                       e Zd ZdZdZy)	HTTPErrorzEException raised for HTTP error responses (4xx and 5xx status codes).zAn HTTP error occurredNr   r   r   r	   r~   r~   ;  s
    O&Gr   r~   c                       e Zd ZdZdZy)HarRecordingErrorz Raised when HAR recording fails.zHAR recording error occurredNr   r   r   r	   r   r   A  s
    *,Gr   r   c                       e Zd ZdZdZy)ScriptExceptionz:Base class for exceptions related to JavaScript execution.z!A script execution error occurredNr   r   r   r	   r   r   G  s
    D1Gr   r   c                       e Zd ZdZdZy)InvalidScriptWithElementzDRaised when a script contains 'argument' but no element is provided.z6Script contains "argument" but no element was providedNr   r   r   r	   r   r   M  s
    NFGr   r   c                       e Zd ZdZdZy)WrongPrefsDictz<Raised when the prefs dict provided contains the 'prefs' keyzDThe dict can not contain "prefs" key, provide only the prefs optionsNr   r   r   r	   r   r   S  s
    FTGr   r   c                       e Zd ZdZdZy)ElementPreconditionErrorzQRaised when invalid or missing preconditions are provided for element operations.zInvalid element preconditionsNr   r   r   r	   r   r   Y  s
    [-Gr   r   N)9r   	Exceptionr   r   r   r   r   r   r!   r#   r%   r'   r)   r+   r-   r/   r1   r4   r6   r8   r:   r<   r>   r@   rB   rD   rF   rH   rJ   rL   rN   rP   rR   rT   rV   rX   r`   rb   rd   rf   rh   rj   rl   rn   rp   rr   rt   rv   rx   rz   r|   r~   r   r   r   r   r   r   r   r	   <module>r      s  	i 	,/ ,1* 13, 33 3 3)& )) )+( +,+ ,$ ,& ,;, ;*. *:/ :* *C. C0& 01' 1-+ -0/ 01' 1+) +6 64& 4+( +0- 0*' *0+ 08) 8# #$& $8) 8;& ;
o 
/_ /71 75/ 5;%; ;; 6 ;=1 =R5 R92 9(o (.o .-/ -(O ()_ )+o +/ /'  '-( -2o 2G GU_ U./ .r   