How do I get info on an exception ?
Raymond Hettinger
vze4rx4y at verizon.net
Sun Jul 20 11:03:50 EDT 2003
> >You could catch it with:
> >
> > except socket.herror, inst:
> > print inst.args
> >
> >or more broadly with:
> >
> > except socket.error, (errno, string_message):
> > print code, message
> >
> >
> >> More importantly, where is the answer documented that I should
> >> have looked?
> >
> >The list of possible socket exceptions is in the docs for sockets.
> >It also describes the (errno, string) return tuple value of inst.args.
> .
> .
> .
> True.
>
> But unsatisfying--at least to me.
Submit a patch.
Raymond Hettinger
More information about the Python-list
mailing list