Re: Re[2]: [PHP] Return or not to return, that is the question

From: Date: Wed, 30 May 2007 18:32:31 +0000
Subject: Re: Re[2]: [PHP] Return or not to return, that is the question
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-255840@lists.php.net to get a copy of this message
At 5/30/2007 10:51 AM, Richard Lynch wrote:
On Wed, May 30, 2007 12:00 pm, Paul Novitski wrote: [snip] use the archives
Good suggestion!
HOWEVER: it is not a good idea, imho, to "always" let the errors bubble up to the outer layer, which is what Paul seemed to have typed...
But didn't.
The problem with that approach is that you end up being painted into a corner where your application can do little more than print "It broke." because the low-level context is not available to the caller of the function.
If you'll refer back to my posting to which you're replying without quoting, you'll read: At 5/30/2007 10:00 AM, Paul Novitski wrote:
Because a low-level error may in turn trigger higher-level errors as it bubbles back up, it may make sense to turn this into an error stack to which each calling function adds its understanding of the problem as the error bubbles back up: ...
When a high-level function receives an error state from a called function, it can (if desired) walk down the stack to learn the technical origin of the error as well as its implications during the bubble-up.
It sounds like we're on the same page, Richard! Regards, Paul __________________________ Paul Novitski Juniper Webcraft Ltd. http://juniperwebcraft.com

« previous php.general (#255840) next »