Files
archived-camoufox/pythonlib/camoufox/exceptions.py
T
Jake WriterandClaude Opus 5.5 4616aa58ca fix(python)!: remove dead public API and make list all --path work
Breaking changes:

- Remove the exceptions UnknownProperty, InvalidDebugPort and
  MissingDebugPort. Nothing in the package raises them, so code catching
  them was catching nothing.
- Remove the legacy `allow_webgl` keyword of launch_options(). Use
  `block_webgl=True`. The keyword now reaches Playwright as an unknown
  launch option and fails there instead of being silently consumed.

`camoufox list all --path` accepted the flag and ignored it. It now prints
the install path beside each installed build, as `camoufox list --path`
already does for the installed tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 20:34:17 -06:00

187 lines
2.8 KiB
Python

class UnsupportedVersion(Exception):
"""
Raised when the Camoufox executable is outdated.
"""
...
class MissingRelease(Exception):
"""
Raised when a required GitHub release asset is missing.
"""
...
class CorruptedDownload(Exception):
"""
Raised when a downloaded asset does not match its expected sha256 digest.
"""
...
class UnsupportedArchitecture(Exception):
"""
Raised when the architecture is not supported.
"""
...
class UnsupportedOS(Exception):
"""
Raised when the OS is not supported.
"""
...
class InvalidPropertyType(Exception):
"""
Raised when the property type is invalid.
"""
...
class InvalidAddonPath(FileNotFoundError):
"""
Raised when the addon path is invalid.
"""
...
class LocaleError(Exception):
"""
Raised when the locale is invalid.
"""
...
class InvalidIP(Exception):
"""
Raised when an IP address is invalid.
"""
...
class InvalidProxy(Exception):
"""
Raised when a proxy is invalid.
"""
...
class UnknownIPLocation(LocaleError):
"""
Raised when the location of an IP is unknown.
"""
...
class InvalidLocale(LocaleError):
"""
Raised when the locale input is invalid.
"""
@classmethod
def invalid_input(cls, locale: str) -> 'InvalidLocale':
return cls(
f"Invalid locale: '{locale}'. Must be either a region, language, "
"language-region, or language-script-region."
)
class UnknownTerritory(InvalidLocale):
"""
Raised when the territory is unknown.
"""
...
class UnknownLanguage(InvalidLocale):
"""
Raised when the language is unknown.
"""
...
class NotInstalledGeoIPExtra(ImportError):
"""
Raised when the maxminddb module is not installed.
"""
...
class NonFirefoxFingerprint(Exception):
"""
Raised when a passed fingerprint is not a Firefox fingerprint.
"""
...
class InvalidOS(ValueError):
"""
Raised when the target OS is invalid.
"""
...
class VirtualDisplayError(Exception):
"""
Raised when there is an error with the virtual display.
"""
...
class CannotFindXvfb(VirtualDisplayError):
"""
Raised when Xvfb cannot be found.
"""
...
pass
class CannotExecuteXvfb(VirtualDisplayError):
"""
Raised when Xvfb cannot be executed.
"""
...
class VirtualDisplayNotSupported(VirtualDisplayError):
"""
Raised when the user tried to use a virtual display on a non-Linux OS.
"""
...
class CamoufoxNotInstalled(FileNotFoundError):
"""
Raised when camoufox is not installed.
"""
...
class ProfileDirectoryError(RuntimeError):
"""Raised when Camoufox's required runtime directory cannot be prepared."""
...