Skip to content

Commit

Permalink
Update version number and add ConnectionClosedError exception
Browse files Browse the repository at this point in the history
  • Loading branch information
AresJef committed Dec 29, 2023
1 parent 6b5ce80 commit efd3747
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = aselenium
version = 0.1.12.7
version = 0.1.12.8
author = Jiefu Chen
author_email = keppa1991@163.com
description = Asyncronous implementation of web browser automation for Python.
Expand Down
3 changes: 2 additions & 1 deletion src/aselenium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
WebDriverError,
WebDriverTimeoutError,
WebdriverNotFoundError,
ConnectionClosedError,
InternetDisconnectedError,
InvalidValueError,
InvalidArgumentError,
Expand Down Expand Up @@ -209,7 +210,7 @@
"ServiceError", "ServiceExecutableNotFoundError", "ServiceStartError", "ServiceStopError",
"ServiceSocketError", "ServiceProcessError", "ServiceTimeoutError",
# . webdriver
"WebDriverError", "WebDriverTimeoutError", "WebdriverNotFoundError", "InternetDisconnectedError",
"WebDriverError", "WebDriverTimeoutError", "WebdriverNotFoundError", "ConnectionClosedError", "InternetDisconnectedError",
"InvalidValueError", "InvalidArgumentError", "InvalidMethodError", "InvalidRectValueError",
"InvalidResponseError", "InvalidExtensionError", "UnknownMethodError", "SessionError",
"SessionClientError", "InvalidSessionError", "IncompatibleWebdriverError", "SessionDataError",
Expand Down
12 changes: 6 additions & 6 deletions src/aselenium/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@ class WebdriverNotFoundError(WebDriverError):
"""Exception raised when target not found."""


class InternetDisconnectedError(WebDriverError):
"""Exception raised when internet disconnected."""


class ConnectionClosedError(WebDriverError):
"""Exception raised when connection closed."""


class InternetDisconnectedError(WebDriverError):
"""Exception raised when internet disconnected."""


# . Inavlid value error
class InvalidValueError(WebDriverError, AseleniumInvalidValueError):
"""Base exception class for all invalid value errors."""
Expand Down Expand Up @@ -779,10 +779,10 @@ def webdriver_error_handler(res: dict[str, Any]) -> None:
if error is UnknownError:
if ErrorCode.FAILED_TO_CHANGE_WINDOW_STATE in message:
error = ChangeWindowStateError
elif ErrorCode.INTERNET_DISCONNECTED in message:
error = InternetDisconnectedError
elif ErrorCode.CONNECTION_CLOSED in message:
error = ConnectionClosedError
elif ErrorCode.INTERNET_DISCONNECTED in message:
error = InternetDisconnectedError
elif error is InvalidSessionError:
if INCOMPATIBLE_DRIVER_PATTERN.search(message) is not None:
error = IncompatibleWebdriverError
Expand Down

0 comments on commit efd3747

Please sign in to comment.