In article 
<[EMAIL PROTECTED]>,
 Thomas Lotze <[EMAIL PROTECTED]> wrote:

> Suppose you have a function f which, as part of its protocol, raises some
> standard exception E under certain, well-defined circumstances. Suppose
> further that f calls other functions which may also raise E. How to best
> distinguish whether an exception E raised by f has the meaning defined by
> the protocol or just comes from details of the implementation?

My recommendation is to define your own exception type(s), and have f 
raise it (them) for errors that are truly generated by f.  Or, if you 
really want to use one of the existing exception types, then perhaps you 
can catch the exceptions from functions called by f, within f itself, 
and raise some other error (or suppress the errors, if appropriate).

Cheers,
-M

-- 
Michael J. Fromberger             | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/  | Dartmouth College, Hanover, NH, USA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to