[Tutor] Exceptions and its error messages

Kent Johnson kent37 at tds.net
Wed May 25 13:32:47 CEST 2005


Jonas Melian wrote:
> How to know all the exceptions that there are? (i.e. OSError, ImportError)

The built-in exceptions are documented here:
http://docs.python.org/lib/module-exceptions.html

Some library modules define their own exceptions such as socket.error so the above is not a complete 
list of exceptions defined in the standard distribution, just the ones that are built-in.

And of course third-party modules and your own code can define new exceptions so I would say it's 
not possible to know *all* the exceptions that there are.

> And all error messages of each exception? (i.e. err_o.strerror,
> err_o.filename)

I don't understand this part of the question; what is err_o?

Kent



More information about the Tutor mailing list