Cathing several potential errors?
gary at byoteki.com
Sun Sep 7 00:38:59 CEST 2008
> if i do
> except TypeError, IndexError:
> only the first error will get caught. I dont want to use Exception and
> catch all errors, but just 2. how can i do that?
what you're doing is assigning the value of TypeError to the name IndexError
except (TypeError, IndexError):
except (TypeError, IndexError), e:
if you want to print the error
More information about the Python-list