Closed felipedau closed 7 years ago
Yes, I think that sounds like a good enhancement, especially if your application may respond differently to different errors.
A separate class for each SOCKS error is fine, I think there's only 6 of them. They should all have SocksError
as a base, though, in case you don't care which error.
In a previous version of txtorcon, some errors raised came from
txsocksx.error
and I was able to check them with:As txsocksx was replaced by txtorcon's own implementation, now the errors are just
SocksError
s and it looks like only their message can be checked ('TTL Expired'
,'Host unreachable'
, etc). Is there a nice way to do that which I am not aware of?Maybe if an
errno
attribute was added to theSocksError
class or, preferably, if each error was an instance of its own class. That way it would be easy to:What do think? Would that be useful? If so, let me know which of the options is preferred. I can send a PR with the changes.
Thanks!