Print Error Type when I catch it

2010-04-22 Thread Jimbo
Hello I have a relatively simple question. I want to use a try except in a function when an error occurs I want to print the error type name(eg IOError, OSError etc) do you know how I can do this without specifying all possible errors, eg having to do this except (IOError, OSError, IndexError,

Re: Print Error Type when I catch it

2010-04-22 Thread Chris Rebert
On Thu, Apr 22, 2010 at 4:50 PM, Jimbo nill...@yahoo.com wrote: I have a relatively simple question. I want to use a try except in a function when an error occurs I want to print the error type name(eg IOError, OSError etc) do you know how I can do this without specifying all possible errors,

Re: Print Error Type when I catch it

2010-04-22 Thread Steven D'Aprano
On Thu, 22 Apr 2010 16:50:30 -0700, Jimbo wrote: Hello I have a relatively simple question. I want to use a try except in a function when an error occurs I want to print the error type name(eg IOError, OSError etc) do you know how I can do this without specifying all possible errors, eg