[Python-3000] The future of exceptions
Aahz
aahz at pythoncraft.com
Fri Sep 8 19:21:51 CEST 2006
On Fri, Sep 08, 2006, Michael Chermside wrote:
>
> def logError(msg):
> try:
> errorChannel.write(msg)
> except IOError:
> pass
>
> try:
> callSomeCode()
> except SomeException as err:
> msg = str(msg)
> logError(msg)
> raise msg
This code is guaranteed to fail in Python 3.0, of course, because string
exceptions aren't allowed. But your point is taken, I think.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"LL YR VWL R BLNG T S" -- www.nancybuttons.com
More information about the Python-3000
mailing list