How do you find what exceptions a class can throw?

Julio Di Egidio julio at diegidio.name
Sun Dec 20 13:46:25 EST 2020


On Sunday, 20 December 2020 at 19:35:21 UTC+1, Karsten Hilbert wrote:

> > If it's a timeout exception I'm going to delay a little while and then 
> > try again. The timeout is probably because the server is busy.
> 
> So what you are looking for is the form of a potential 
> "timeout exception" (say, exception name) ? 
> 
> Provoke one and have a look. 
> 
> Then catch what you saw.

<https://docs.python.org/3.8/library/socket.html#socket.timeout>

Programmers don't guess...

HTH,

Julio


More information about the Python-list mailing list