Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-10 Thread Richard Quadling
On 9 February 2010 22:25, wrote: > On Tue, 9 Feb 2010 16:09:05 +, rquadl...@googlemail.com (Richard > Quadling) wrote: > >>On 9 February 2010 14:20, Ashley Sheridan wrote: >>> >>> On Tue, 2010-02-09 at 09:19 -0500, Robert Cummings wrote: >>> >>> Richard wrote: >>> > Hi, >>> > >>> >> I have

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Rene Veerman
On Wed, Feb 10, 2010 at 3:04 AM, Paul M Foster wrote: > $d = funcD($q); > // tests if necessary > $c = funcC($p); > // tests if necessary > $b = funcB($c); > // tests if necessary > $r = funcA($b, $d); > You're right. I knew when i was posting my last reply yesterday that i had made things probab

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Paul M Foster
On Tue, Feb 09, 2010 at 11:38:42PM +0100, Rene Veerman wrote: > Well, i've thought of a few ways to allow localized overriding of > values returned by functions in case of an error. > > I have yet to figure out what the exact advantages are of this > code-standard, but the overhead seems acceptab

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Rene Veerman
Well, i've thought of a few ways to allow localized overriding of values returned by functions in case of an error. I have yet to figure out what the exact advantages are of this code-standard, but the overhead seems acceptable and i recon this, when done, will beat the "trigger_error()-try-catch"

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread clancy_1
On Tue, 9 Feb 2010 16:09:05 +, rquadl...@googlemail.com (Richard Quadling) wrote: >On 9 February 2010 14:20, Ashley Sheridan wrote: >> >> On Tue, 2010-02-09 at 09:19 -0500, Robert Cummings wrote: >> >> Richard wrote: >> > Hi, >> > >> >> I have extended the standard exception class to send me

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Richard
Hi, >> Real developers don't have errors in their code; they're undocumented >> features ;) Or alternatively, if you freelance - "Forthcoming employment opportunities" :-) -- Richard Heyes HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 7th February) Lots of PHP and Javascript c

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Richard Quadling
On 9 February 2010 14:20, Ashley Sheridan wrote: > > On Tue, 2010-02-09 at 09:19 -0500, Robert Cummings wrote: > > Richard wrote: > > Hi, > > > >> I have extended the standard exception class to send me an email > >> whenever an exception occurs. > > > > I did that once. Once being the operative w

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Robert Cummings
Ashley Sheridan wrote: On Tue, 2010-02-09 at 09:19 -0500, Robert Cummings wrote: Richard wrote: Hi, I have extended the standard exception class to send me an email whenever an exception occurs. I did that once. Once being the operative word... :-) Ended up with tens of thousands of emails

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Ashley Sheridan
On Tue, 2010-02-09 at 09:19 -0500, Robert Cummings wrote: > Richard wrote: > > Hi, > > > >> I have extended the standard exception class to send me an email > >> whenever an exception occurs. > > > > I did that once. Once being the operative word... :-) Ended up with > > tens of thousands of ema

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Robert Cummings
Richard wrote: Hi, I have extended the standard exception class to send me an email whenever an exception occurs. I did that once. Once being the operative word... :-) Ended up with tens of thousands of emails one morning. At first I thought... "Wow, maybe my popularity has grown somewhat". B

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Richard
Hi, > But I bet you REALLY quickly fixed the problem! I just took out the error handling. :-) -- Richard Heyes HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 7th February) Lots of PHP and Javascript code - http://www.phpguru.org -- PHP General Mailing List (http://www.php.net/

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Richard Quadling
On 9 February 2010 12:55, Richard wrote: > Hi, > >> I have extended the standard exception class to send me an email >> whenever an exception occurs. > > I did that once. Once being the operative word... :-) Ended up with > tens of thousands of emails one morning. At first I thought... "Wow, > may

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Richard
Hi, > I have extended the standard exception class to send me an email > whenever an exception occurs. I did that once. Once being the operative word... :-) Ended up with tens of thousands of emails one morning. At first I thought... "Wow, maybe my popularity has grown somewhat". But it hadn't.

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Richard Quadling
On 9 February 2010 11:48, Nathan Rixham wrote: > Rene Veerman wrote: >> Hi, >> >> I'm looking for a strategy to do informative error handling at all >> levels of my code, yet keep these errors non-fatal as often as >> possible. > > error_log - for logging errors > throw Exception - for show stoppe

[PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Nathan Rixham
Rene Veerman wrote: > Hi, > > I'm looking for a strategy to do informative error handling at all > levels of my code, yet keep these errors non-fatal as often as > possible. error_log - for logging errors throw Exception - for show stoppers try/catch - for when you can handle a potential show sto

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-08 Thread Teus Benschop
On Tue, 2010-02-09 at 07:22 +0100, Rene Veerman wrote: > I would also like to hear suggestions on how to fix this mess: > > $r = funcA ( funcB ( funcC ( $p ) ) ); > > if funcB() / funcC() fails, how would you fudge/abort the calling > function in the chain? > One may think that funcA and funcB ju

[PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-08 Thread Rene Veerman
I would also like to hear suggestions on how to fix this mess: $r = funcA ( funcB ( funcC ( $p ) ) ); if funcB() / funcC() fails, how would you fudge/abort the calling function in the chain? One may think that funcA and funcB just check their parameters list for being "error" arrays, but the prob