Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pythonlib/camoufox/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def public_ip(proxy: Optional[str] = None) -> str:
"https://ipecho.net/plain",
]

exception = None
last_exception = None
for url in URLS:
try:
with _suppress_insecure_warning():
Expand All @@ -116,5 +116,5 @@ def public_ip(proxy: Optional[str] = None) -> str:
validate_ip(ip)
return ip
except (requests.exceptions.ProxyError, requests.RequestException, InvalidIP) as exception:
pass
raise InvalidIP(f"Failed to get IP address: {exception}")
last_exception = exception
raise InvalidIP(f"Failed to get IP address: {last_exception}")