[Tutor] Error frameworks

Kent Johnson kent37 at tds.net
Wed Sep 21 18:55:20 CEST 2005

DS wrote:
> Hi
> Is there any particular standard or approach that I should use for an
> error framework?  For example, suppose I have a set of functions that
> call one another, and an error is triggered.  I want an error message to
> be passed back to the user, so I could:

Raise an exception, either a built-in if one is appropriate, or one that you define.
http://docs.python.org/tut/node10.html tells you how
http://docs.python.org/lib/module-exceptions.html lists the built-in exceptions and what they mean

>      1. have an error message passed back to each called function until
> it bubbles up to a point to be passed back to the user in some
> meaningful way.
>      2. have a singleton error object updated.

Both these approaches have several drawbacks:
- Errors are easy to ignore or forget to handle
- Client code gets cluttered up with error-handling code

>      3.  ??
> What do most people use?  Is there any url that you could point me to
> that would help educate me on this point?
> Thanks
> ds
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

More information about the Tutor mailing list