In article <[EMAIL PROTECTED]>,
Simon Willison <[EMAIL PROTECTED]> wrote:
>
>try:
> do_something()
>except HttpError:
> # An HTTP error occurred
>except ApplicationError:
> # An application error occurred
>else:
> # It worked!
Use a similar but different idiom:
try:
do_something()
except DoSomethingError:
# handle error
IOW, your do_something() function maps all expected errors to
DoSomethingError (or at least to a series of related exceptions that are
all subclasses of DoSomethingError).
--
Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/
"LL YR VWL R BLNG T S" -- www.nancybuttons.com
--
http://mail.python.org/mailman/listinfo/python-list