[PHP-DEV] Error handling (no redirect)

2002-11-26 Thread Melvyn Sopacua
Hi, having ported a site from ColdFusion to PHP in a very short time frame, I can safely say, ColdFusion is an overpriced templating system and not a scripting language. There is one convenience however, and that is that any error can be handled by the end user. I found it very inconvenient that

Re: [PHP-DEV] error handling

2002-11-21 Thread Ivan Ristic
James Cox wrote: Also, from a management point of view (I manage programmers), what you are describing there can work in some cases but what if a programmer forgets/is-too-lazy to to that? I don't want to wait for the next morning to know about it. if a programmer is too lazy to test, f

RE: [PHP-DEV] error handling

2002-11-21 Thread James Cox
>Also, from a management point of view (I manage programmers), >what you are describing there can work in some cases but what >if a programmer forgets/is-too-lazy to to that? I don't want >to wait for the next morning to know about it. > if a programmer is too lazy to test, fire th

RE: [PHP-DEV] error handling

2002-11-21 Thread James Cox
> > In Real Life [Patent Pending], if you cripple your production site > in the middle of the night then go to bed, you won't have to worry > about any of this because you'd be unemployed in the morning. +1... don't commit code without QA! > > I agree with Derick's assessment. > > I always have th

RE: [PHP-DEV] error handling

2002-11-21 Thread James Cox
systems -- eg, for 404. -- james > -Original Message- > From: Maxim Maletsky [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 21, 2002 12:15 PM > To: James Cox > Cc: [EMAIL PROTECTED]; 'PHP Developers Mailing List' > Subject: Re: [PHP-DEV] error handling &g

Re: [PHP-DEV] error handling

2002-11-21 Thread Ivan Ristic
We were talking about parse errors here. php -l before you put it life should be enough for that. And yes, I run that before 'cvs commit'. Well, I am afraid that it is not that simple, as there are other fatal errors that cannot be caught and where lint is useless. For example, $object

Re: [PHP-DEV] error handling

2002-11-21 Thread Derick Rethans
On Thu, 21 Nov 2002, Ivan Ristic wrote: > Mike Robinson wrote: > > > In Real Life [Patent Pending], if you cripple your production site > > in the middle of the night then go to bed, you won't have to worry > > about any of this because you'd be unemployed in the morning. > >I assume then th

Re: [PHP-DEV] error handling

2002-11-21 Thread Ivan Ristic
Mike Robinson wrote: In Real Life [Patent Pending], if you cripple your production site in the middle of the night then go to bed, you won't have to worry about any of this because you'd be unemployed in the morning. I assume then that you run regression tests for your web sites after every

RE: [PHP-DEV] error handling

2002-11-21 Thread Mike Robinson
In Real Life [Patent Pending], if you cripple your production site in the middle of the night then go to bed, you won't have to worry about any of this because you'd be unemployed in the morning. I agree with Derick's assessment. I always have the option of turning display errors off (which is th

RE: [PHP-DEV] error handling

2002-11-21 Thread John Coggeshall
ror -- perl, cgi, mod_include, etc all do >> it, so why shouldn't php? >> >> -- james >> >> > -Original Message- >> > From: John Coggeshall [mailto:[EMAIL PROTECTED]] >> > Sent: Wednesday, November 20, 2002 11:06 PM >> > To: 'Jame

Re: [PHP-DEV] error handling

2002-11-21 Thread Maxim Maletsky
mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, November 20, 2002 11:06 PM > > To: 'James Cox' > > Cc: 'PHP Developers Mailing List' > > Subject: RE: [PHP-DEV] error handling > > > > > > > > >true... > > > > &g

Re: [PHP-DEV] error handling

2002-11-21 Thread Nick Loman
Hello PHP-Developers I have an idea! I recently went through the pain of creating an ISAPI DLL for IIS and what I found was that IIS was *incredibly* sensitive to things "going wrong" in the DLL with the result that the IIS process would hang and the whole damn machine would need a "reboot" on

Re: [PHP-DEV] error handling

2002-11-21 Thread Maxim Maletsky
Derick Rethans <[EMAIL PROTECTED]> wrote... : > On Thu, 21 Nov 2002, John Coggeshall wrote: > > Again, what about IIS, etc? > > Who cares? :) It really would be much better if some person who thinks > IIS rulez fixes the ISAPI module. If that doesn't work correctly nobody > should use it at

Re: [PHP-DEV] error handling

2002-11-21 Thread Ivan Ristic
Edin Kadribasic wrote: On Thursday 21 November 2002 08:04, Derick Rethans wrote: >I still think that an included file just should fail hard and I just >dont like this kind of obfucsication. I agree with this 100%. It is IMHO a complete waste of time trying to handle parse errors gracefully. M

Re: [PHP-DEV] error handling

2002-11-21 Thread Ivan Ristic
John Coggeshall wrote: If I hacked on the source a bit and got this redirect-error thing working, would it Be perhaps worthy of a commit? +1 Bye, Ivan -- PHP Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] error handling

2002-11-21 Thread Edin Kadribasic
On Thursday 21 November 2002 08:04, Derick Rethans wrote: > I still think that an included file just should fail hard and I just > dont like this kind of obfucsication. I agree with this 100%. It is IMHO a complete waste of time trying to handle parse errors gracefully. Most "solutions" proposed

RE: [PHP-DEV] error handling

2002-11-20 Thread Derick Rethans
On Thu, 21 Nov 2002, John Coggeshall wrote: > >Who cares? :) It really would be much better if some person > >who thinks > >IIS rulez fixes the ISAPI module. If that doesn't work > >correctly nobody > >should use it at all. > > I'm not saying I'm a IIS fan. :) I rather implement one solution

RE: [PHP-DEV] error handling

2002-11-20 Thread John Coggeshall
>Who cares? :) It really would be much better if some person >who thinks >IIS rulez fixes the ISAPI module. If that doesn't work >correctly nobody >should use it at all. I'm not saying I'm a IIS fan. :) I rather implement one solution Which works, period. IMHO that's better than have differen

RE: [PHP-DEV] error handling

2002-11-20 Thread Derick Rethans
On Thu, 21 Nov 2002, John Coggeshall wrote: > > > >If ErrorDocument is implemented as a sub-request in Apache, it > >would be > >enough for PHP to set one or more Apache notes with the necessary > >information. > > Again, what about IIS, etc? Who cares? :) It really would be much better if

RE: [PHP-DEV] error handling

2002-11-20 Thread John Coggeshall
> >If ErrorDocument is implemented as a sub-request in Apache, it >would be >enough for PHP to set one or more Apache notes with the necessary >information. Again, what about IIS, etc? John -- PHP Development Mailing List To unsubscribe, visit: http://www.php.net/unsu

RE: [PHP-DEV] error handling

2002-11-20 Thread Stig S. Bakken
On Wed, 20 Nov 2002, John Coggeshall wrote: > |>And how about that we change PHP so that it changes > |>the status of the response to 500 on a fatal error? Then > |>you would be able to use the Apache directive > |> > |>ErrorDocument 500 /handle-my-errors.php > |> > |>to deal

RE: [PHP-DEV] error handling

2002-11-20 Thread John Coggeshall
t flexablity to deal with any error PHP is going to throw at a user without breaking old code. Please RFC of course :) John >-Original Message- >From: Chris Shiflett [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, November 20, 2002 6:31 PM >To: [EMAIL PROTECTED]; [EMAIL

Re: [PHP-DEV] error handling

2002-11-20 Thread Ivan Ristic
The problem with this is that the 500 error does not provide any information about the error. To the user, no. I wouldn't want users to see low level error messages anyway. Since standard error handlers can catch "normal" messages, the fact that a 500 error has occured means that someth

RE: [PHP-DEV] error handling

2002-11-20 Thread Chris Shiflett
--- John Coggeshall <[EMAIL PROTECTED]> wrote: > See, the problem that I'm seeing here is that I don't believe PHP > is reponsible for setting the error code returned by PHP.. For > instance, a 404 error isn't handle by PHP at all. Likewise, I don't > think PHP can say "turn this into a 500 error"

RE: [PHP-DEV] error handling

2002-11-20 Thread James Cox
ED]] > Sent: Wednesday, November 20, 2002 11:17 PM > To: James Cox > Cc: 'PHP Developers Mailing List' > Subject: RE: [PHP-DEV] error handling > > > The problem with this is that the 500 error does not provide any > information about the error. > > Which for me

RE: [PHP-DEV] error handling

2002-11-20 Thread Ray Hunter
t; why shouldn't php? > > -- james > > > -Original Message- > > From: John Coggeshall [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, November 20, 2002 11:06 PM > > To: 'James Cox' > > Cc: 'PHP Developers Mailing List' > > S

RE: [PHP-DEV] error handling

2002-11-20 Thread James Cox
Developers Mailing List' > Subject: RE: [PHP-DEV] error handling > > > > >true... > > > >i'd like to see a 500 error though, and some persistent vars... > > See, the problem that I'm seeing here is that I don't believe PHP is > reponsible f

RE: [PHP-DEV] error handling

2002-11-20 Thread John Coggeshall
don't think PHP can say "turn this into a 500 error" to Apache. John > > -- james > >> -Original Message- >> From: John Coggeshall [mailto:[EMAIL PROTECTED]] >> Sent: Wednesday, November 20, 2002 10:48 PM >> To: 'James Cox'

RE: [PHP-DEV] error handling

2002-11-20 Thread John Coggeshall
|>And how about that we change PHP so that it changes |>the status of the response to 500 on a fatal error? Then |>you would be able to use the Apache directive |> |>ErrorDocument 500 /handle-my-errors.php |> |>to deal with them. You would have to use output buffering, |>o

Re: [PHP-DEV] error handling

2002-11-20 Thread Stig S. Bakken
On Wed, 20 Nov 2002, Ivan Ristic wrote: > > Create a configuration directive error_handler which accepts one of > > Two values... Either a PHP script (like auto_prepend) which is > >And how about that we change PHP so that it changes >the status of the response to 500 on a fatal error? Th

Re: [PHP-DEV] error handling

2002-11-20 Thread Ivan Ristic
Create a configuration directive error_handler which accepts one of Two values... Either a PHP script (like auto_prepend) which is And how about that we change PHP so that it changes the status of the response to 500 on a fatal error? Then you would be able to use the Apache directive

Re: [PHP-DEV] error handling

2002-11-20 Thread Ivan Ristic
John Coggeshall wrote: |I know this is possible now, but not within the error handling |function of PHP, or without setting a custom error handler. Well, it's not really possible now -- a E_PARSE won't get thrown to a custom PHP handler, it'll just die with a parse error. It is possible. Not

Re: [PHP-DEV] error handling

2002-11-18 Thread Melvyn Sopacua
At 13:56 18-11-2002, Derick Rethans wrote: On Mon, 18 Nov 2002, Melvyn Sopacua wrote: > At 11:39 18-11-2002, Derick Rethans wrote: > > [...] > > > > Or a more general command to verify PHP code > > > php_valid($code_str). That way the people who expect parse errors in > > > their include files

Re: [PHP-DEV] error handling

2002-11-18 Thread Kjartan Mannes
Monday, November 18, 2002, 3:03:39 PM, John Coggeshall wrote: > What are you doing giving users access to eval()??? That's an incredibly > huge security risk allowing an arbitary user to execute code of their > choosing on your server... (I shiver to think if you actually had the > PEAR Inline_C in

RE: [PHP-DEV] error handling

2002-11-18 Thread John Coggeshall
>> http://somewhere.com/error.php?errno=4";); ?> > >> This way, users who don't care can still re-direct a browser >to a nice >> and pretty "sorry, the server is really screwed" HTML page... Or, if >> they'd like, they can simply take that error number and create a >> error-handler in PHP witho

Re: [PHP-DEV] error handling

2002-11-18 Thread Maxim Maletsky
It would still be good to have as there are tons of sites that use sessions and plain header() calls - they care of not having the output before processing is done. If E_PARSE error happens after an output the header() can fail bad too with headers sent message. But, if one wants to control well

Re: [PHP-DEV] error handling

2002-11-18 Thread Kjartan Mannes
Monday, November 18, 2002, 11:43:48 AM, John Coggeshall wrote: > Back on the note that I was discussing (the E_PARSE with a user > error-handler), Perhaps the issue can be slightly skirted without having > to code a whole lot... Specifically, what about simply re-directing the > user to another URL

Re: [PHP-DEV] error handling

2002-11-18 Thread Maxim Maletsky
"John Coggeshall" <[EMAIL PROTECTED]> wrote... : > What about require'd files? > > Back on the note that I was discussing (the E_PARSE with a user > error-handler), Perhaps the issue can be slightly skirted without having > to code a whole lot... Specifically, what about simply re-directing th

RE: [PHP-DEV] error handling

2002-11-18 Thread John Coggeshall
>hmm, I really thought we didn't have one, as it doesn't make sense at >all :) Ha! I'm not crazy! :) >>Having a solid way to >> gracefully bow-out because my cat managed to open, fill with >junk, and >> save a critical include file would just be nice. The choice between >> the blank screen,

RE: [PHP-DEV] error handling

2002-11-18 Thread Marcus Börger
After all the decision what about an ini directive that makes it possible to send back another file that contains the error message? That would be something like apaches ability to direct some errors to some special pages. The main problem would be how to pass the error information to that script.

RE: [PHP-DEV] error handling

2002-11-18 Thread Derick Rethans
On Mon, 18 Nov 2002, John Coggeshall wrote: > >uhm, John, we dont have a E_PARSE yet. > > It's late... I actually stared at that sentence for about 30 seconds > trying to determine if I had spelled PARSE wrong... Then I actually went > and checked the manual to make sure I hadn't lost my mind an

RE: [PHP-DEV] error handling

2002-11-18 Thread John Coggeshall
>uhm, John, we dont have a E_PARSE yet. It's late... I actually stared at that sentence for about 30 seconds trying to determine if I had spelled PARSE wrong... Then I actually went and checked the manual to make sure I hadn't lost my mind and there was actually a E_PARSE constant... Now I'm just

RE: [PHP-DEV] error handling

2002-11-18 Thread Derick Rethans
On Mon, 18 Nov 2002, John Coggeshall wrote: > >> Can't argue with that, however (;)), I find it annoying that PHP stops > >> processing if there is a parse error passed to an eval() command. I'd > >> like a way to make eval() just return E_PARSE if the script passed to > >> it fails. > > This

Re: [PHP-DEV] error handling

2002-11-18 Thread Derick Rethans
On Mon, 18 Nov 2002, Melvyn Sopacua wrote: > At 11:39 18-11-2002, Derick Rethans wrote: > > [...] > > > > Or a more general command to verify PHP code > > > php_valid($code_str). That way the people who expect parse errors in > > > their include files can do > > > > > > $code_str(implode("",

Re: [PHP-DEV] error handling

2002-11-18 Thread Mattia
> Can't argue with that, however (;)), I find it annoying that PHP stops > processing if there is a parse error passed to an eval() command. I'd > like a way to make eval() just return E_PARSE if the script passed to it > fails. Or a more general command to verify PHP code well, well, well... ever

RE: [PHP-DEV] error handling

2002-11-18 Thread John Coggeshall
>> Can't argue with that, however (;)), I find it annoying that >PHP stops >> processing if there is a parse error passed to an eval() >command. I'd >> like a way to make eval() just return E_PARSE if the script >passed to >> it fails. This is exactly the type of situation where E_PARSE real

Re: [PHP-DEV] error handling

2002-11-18 Thread Melvyn Sopacua
At 11:39 18-11-2002, Derick Rethans wrote: [...] > Or a more general command to verify PHP code > php_valid($code_str). That way the people who expect parse errors in > their include files can do > > $code_str(implode("", file("include.inc"))); > if (php_valid($code_str)) { > include_on

Re: [PHP-DEV] error handling

2002-11-18 Thread John Bradford
> I don't like this patch because it doesn't add anything to PHP itself. > You can easily do this with the error_prepend_string and > error_append_string configuration settings. > You were also told that this functionality can be achieved with > error_prepend_string and error_append_string ini

Re: [PHP-DEV] error handling

2002-11-18 Thread Derick Rethans
On Mon, 18 Nov 2002, Kjartan Mannes wrote: > Monday, November 18, 2002, 11:23:08 AM, Derick Rethans wrote: > > That can be done, but I don't like this. You should not have any > > parse errors in your code anyway, so it just should fail as hard as > > possible. > > Can't argue with that, however

Re: [PHP-DEV] error handling

2002-11-18 Thread Kjartan Mannes
Monday, November 18, 2002, 11:23:08 AM, Derick Rethans wrote: > That can be done, but I don't like this. You should not have any > parse errors in your code anyway, so it just should fail as hard as > possible. Can't argue with that, however (;)), I find it annoying that PHP stops processing if t

RE: [PHP-DEV] error handling

2002-11-18 Thread Derick Rethans
On Mon, 18 Nov 2002, John Coggeshall wrote: > > >Core errors are _fatal_ because it leaves the engine in an unclean > >state. If you have a parse error then the script hasn't been parsed > >fully and thus the compilation step did not even interpreted > >the tokens > >generated by the parse,

Re: [PHP-DEV] error handling

2002-11-18 Thread Edin Kadribasic
On Mon, 18 Nov 2002, John Bradford wrote: > On a similar note, I posted a patch a few days ago which was intended > for development environments - it makes error messages appear in a > clear 'window' in the middle of the browser window, so that you don't > have to hunt around in the output of the

Re: [PHP-DEV] error handling

2002-11-18 Thread Derick Rethans
On Mon, 18 Nov 2002, John Bradford wrote: > > I think in a modern web application the error handling function should do > > the following: > > in case of error (any: parse error, internal application error,) > > > > 1. a message should be shown to the user sayng that an error has occured > >

FW: [PHP-DEV] error handling

2002-11-18 Thread John Coggeshall
: 'Derick Rethans' >Subject: RE: [PHP-DEV] error handling > > > >>Core errors are _fatal_ because it leaves the engine in an unclean >>state. If you have a parse error then the script hasn't been parsed >>fully and thus the compilation step did not even inte

Re: [PHP-DEV] error handling

2002-11-18 Thread John Bradford
> I think in a modern web application the error handling function should do > the following: > in case of error (any: parse error, internal application error,) > > 1. a message should be shown to the user sayng that an error has occured > like "an internal error has occured. the webmaster has

Re: [PHP-DEV] error handling

2002-11-18 Thread Mattia
"Rasmus Lerdorf" <[EMAIL PROTECTED]> ha scritto nel messaggio [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Well, I certainly don't want errors handled this way for my web apps. Well, would you please tell us why and propose an alternative? Mattia -- PHP Development Mailing List

Re: [PHP-DEV] error handling

2002-11-18 Thread Mattia
"John Coggeshall" <[EMAIL PROTECTED]> ha scritto nel messaggio 001201c28ed8$a2fb6620$3801a8c0@cooglewin">news:001201c28ed8$a2fb6620$3801a8c0@cooglewin... > > |And this can never be supported safely, as a parse error leaves the > |parse in an unstable state. Also, I really don't think that we shoul

RE: [PHP-DEV] error handling

2002-11-18 Thread Derick Rethans
On Mon, 18 Nov 2002, John Coggeshall wrote: > >Both? I'm not totally sure what you mean with "when the custom error > >handler also has errors". Can you elaborate? > > Okay > > > set_error_handler("myerrorhandler"); > > function myerrorhandler($errno, $errstr, $errfile, $errl

RE: [PHP-DEV] error handling

2002-11-18 Thread John Coggeshall
>Both? I'm not totally sure what you mean with "when the custom error >handler also has errors". Can you elaborate? Okay Which would output something like this: Error: There was an parse error on line X of file.php. Additional Error: Custom error handler myerrorhandler() also errored in l

Re: [PHP-DEV] error handling

2002-11-18 Thread Rasmus Lerdorf
Well, I certainly don't want errors handled this way for my web apps. And you would be hard pressed to find 2 people on this list that agree exactly how to do it which is why PHP provides you with the tools to do it any way you want. -Rasmus On Mon, 18 Nov 2002, Mattia wrote: > I think in a mod

RE: [PHP-DEV] error handling

2002-11-18 Thread Derick Rethans
On Mon, 18 Nov 2002, John Coggeshall wrote: > > |And this can never be supported safely, as a parse error leaves the > |parse in an unstable state. Also, I really don't think that we should > |try to add hacks to make this possible. > > Is this directed toward my wish (of having a secondary er

RE: [PHP-DEV] error handling

2002-11-18 Thread John Coggeshall
|And this can never be supported safely, as a parse error leaves the |parse in an unstable state. Also, I really don't think that we should |try to add hacks to make this possible. Is this directed toward my wish (of having a secondary error if the custom error handler also errors) or toward Ma

RE: [PHP-DEV] error handling

2002-11-18 Thread Derick Rethans
On Mon, 18 Nov 2002, John Coggeshall wrote: > > |I know this is possible now, but not within the error handling > |function of PHP, or without setting a custom error handler. > > Well, it's not really possible now -- a E_PARSE won't get thrown to a > custom PHP handler, it'll just die with a pa

RE: [PHP-DEV] error handling

2002-11-17 Thread John Coggeshall
|I know this is possible now, but not within the error handling |function of PHP, or without setting a custom error handler. Well, it's not really possible now -- a E_PARSE won't get thrown to a custom PHP handler, it'll just die with a parse error. If there is an improvement to be made, perha

[PHP-DEV] error handling

2002-11-17 Thread Mattia
I think in a modern web application the error handling function should do the following: in case of error (any: parse error, internal application error,) 1. a message should be shown to the user sayng that an error has occured like "an internal error has occured. the webmaster has been notifie

[PHP-DEV] Error Handling

2002-04-02 Thread Adam Voigt
At our web hosting facillity we have several developers (each who recieve a seperate email when an error occurs on the site there working on) and we would like to have extra data included in the log files which are written (such as the $_POST, $_GET, $_ENV, and $_SERVER arrays), this would help u