I understand your approach! Off course, if I have to create a script destined to the final user, bad data will not be send internally between the functions. I have just to test if the input data are of the right type. If not, I will just send a message on the screen (bad user… wchoo-tisshh wchooooooo-tissssshhhh) and quit the script normally.
But if I give a code snippet to others programmers, the error trapping could take his meaning. The case is really different. Others programmers could use the function and they don’t always clearly understand the right type to use as input (especially if they skim the doc partially). Receiving a clear message in this case could be a good help.
Of course, if I not careful of the errors, the script will also end with a crash… Which is the same than controlled error :-/
So… finally we don’t have to be careful of the internal errors in a script ?