|
When reporting errors, should we get the error to be reported in the procedure that is being called, or if we know a subsequent procedure call will pick it up, can we wait until then?Technically, the execution of a procedure includes all of the recursive executions of that procedure and others that happen as a result. So, when a procedure has a responsibility to report an error, it may satisfy that responsibility by calling another procedure to do so. In effect, that always happens when you call error to do the error reporting.
But there are two reasons to prefer putting each procedure's error reporting code directly in its body rather than depending on another procedure in the abstraction that it calls:
Mike O'D. |
to: