Exceptions
proxylib.exceptions
The exceptions proxylib raises.
Every library error derives from :class:ProxylibError. None of them derives
from KeyError: a proxy map raises KeyError to mean "no opinion, ask the
next map", and an error must never be mistaken for that.
__all__ = ('ProxylibError', 'ProxyParseError', 'PACError', 'NoReachableProxyError', 'MissingExtraError', 'UnsupportedProxyError')
module-attribute
MissingExtraError(feature, *, name, extra=None)
Bases: ProxylibError, ImportError
An optional dependency is not installed.
extra is the proxylib extra that installs it, or None when the
dependency is a client library proxylib integrates with and has no extra
for (requests); name is the module that failed to import. The
message names the pip install line.
Source code in src/proxylib/exceptions.py
48 49 50 51 52 | |
extra = extra
instance-attribute
feature = feature
instance-attribute
NoReachableProxyError
Bases: ProxylibError, LookupError
None of the proxies offered for a request accepted a connection.
PACError
Bases: ProxylibError
A PAC script failed: it raised, returned no usable answer in time, or could not be loaded as a script.
ProxyParseError
Bases: ProxylibError, ValueError
Text that should name a proxy, or a PAC result, could not be parsed.
ProxylibError
Bases: Exception
Base class of every error proxylib raises.
UnsupportedProxyError(client, refused)
Bases: ProxylibError
A client was offered only proxies it cannot use: a URL-prefix gateway or a SOCKS proxy for a client without them, or a proxy header the client cannot keep from the server. Entries it can use are tried instead when the answer has any.
client names the client; proxies are the entries offered, and
reasons says why each was refused.
Source code in src/proxylib/exceptions.py
66 67 68 69 70 71 72 | |