But for how to do with errors, see the sibling comments to this one, and good libraries will give you an inheritance tree of exceptions
But for how to do with errors, see the sibling comments to this one, and good libraries will give you an inheritance tree of exceptions
By catching all exceptions as close as possible of the request you make, you can at least do something about it.
As for the tree of exceptions, it works well for a while until networks become unreliable, until remote peers start presenting certificates broken in subtle ways... You end up adding ranges of exception in the except clause as new ones are popping on Sentry. Then you get tired of it so you catch "Exception".
This is the unfortunate story of every single project I do that deals with network calls on the Internet.
My modules do catch SystemExit and KeyboardInterrupt before the bare exception and simply re-raise those.