-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
It would be helpful to have a common base exception that all proxy errors inherit from, so users can catch all proxy-related errors with a single except block when needed.
Currently, catching all proxy-related exceptions requires handling three separate exception types:
try:
# proxy code
except (ProxyError, ProxyTimeoutError, ProxyConnectionError) as e:
# handle errorThis is because ProxyTimeoutError and ProxyConnectionError don't inherit from a common base exception.
Multiple inheritance could maintain compatibility with built-in exceptions while allowing a single catch block. This pattern is used by other libraries like aiohttp:
class InvalidUrlRedirectClientError(InvalidUrlClientError, RedirectClientError):
"""Invalid URL redirect client error."""Metadata
Metadata
Assignees
Labels
No labels