How do I find what kind of exception is thrown.

William Ray Wing wrw at mac.com
Tue Sep 5 13:54:57 EDT 2017


> On Sep 5, 2017, at 4:50 AM, Antoon Pardon <antoon.pardon at vub.be> wrote:
> 
> Python 2.6.4 on a solaris box.
> 
> I have a program in which all kind of excptions can be thrown and caugth.
> The main program is something like below:
> 
> try:
>    do_stuff
> except Exception:
>    log unexpected trouble
> 
> Now I found the following in the logs: [Errno 131] Connection reset by peer
> 

“Connection reset by peer” is a network problem.  It looks to your program as though the connection has been dropped.

> This is a problem I would like to catch earlier however I have no idea what
> exception I would have to catch in order to treat this case.
> 
> -- 
> Antoon Pardon
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list