[Tutor] Should error checking be duplicated for both functions if one function calls another one?

boB Stepp robertvstepp at gmail.com
Mon Jun 1 16:37:47 CEST 2015


On Mon, Jun 1, 2015 at 9:33 AM, David Palao <dpalao.python at gmail.com> wrote:
> Hello,
> Not sure if I got it, but, in my opinion functions should do only one
> thing.So if function 2 finds an error, it should raise it. There
> should be another function  (function 1 in your case?) taking care of
> possible raised errors.

I guess my question was not clearly worded. The idea is that function
1 calls another function. Function 1 checks for possible errors that
are relevant. Some or all of these checks are also relevant to the
called function. Should the called function also include these
relevant error checks?

boB


More information about the Tutor mailing list