[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I find what kind of exception is thrown.

It looks to me like an OSError, can it be?


2017-09-05 10:50 GMT+02:00 Antoon Pardon <antoon.pardon at vub.be>:
> 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
> 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