|
Deprecating trigger_error calls in the Tarot cards? April 08, 2011 04:10PM |
Registered: 2 years ago Posts: 17 |
In some environments setting up your own PHP error_handler using set_error_handler() is not an option. Have you considered converting all the trigger_error() calls to throw exceptions?
There are 51 locations that have trigger_error calls and 23 that throw *Exception in 4.2.0.
Is that a 5.x change? Or something that could be rolled into 4.3.x 4.4.0?
|
Re: Deprecating trigger_error calls in the Tarot cards? April 08, 2011 04:33PM |
Admin Registered: 6 years ago Posts: 2,639 |
|
Re: Deprecating trigger_error calls in the Tarot cards? April 08, 2011 04:40PM |
Registered: 2 years ago Posts: 17 |
Hmm...what I'm trying to do is capture the bad HTML could not be handled for whatever reason. If it would be enough just to catch exceptions when in a production environment then that'll be golden.
I'm just concerned that when this is in a production environment that when there is some crazy-ass HTML passed that I couldn't log it and adjust the settings/filters accordingly.
|
Re: Deprecating trigger_error calls in the Tarot cards? April 08, 2011 04:57PM |
Admin Registered: 6 years ago Posts: 2,639 |
|
Re: Deprecating trigger_error calls in the Tarot cards? April 08, 2011 05:00PM |
Registered: 2 years ago Posts: 17 |
Yeah I saw you guys doing that. You also do that around iconv. You did that because even when using the @ character to surpress the error messages the error handler function is still called. And then another you did to surpress the E_STRICT messages.
Very nice solutions.
Ok so for now I will go with the assumption that really crappy HTML will not generate trigger_errors(), but instead throw an Exception that can be caught.
|
Re: Deprecating trigger_error calls in the Tarot cards? April 08, 2011 05:20PM |
Admin Registered: 6 years ago Posts: 2,639 |
|
Re: Deprecating trigger_error calls in the Tarot cards? April 08, 2011 05:21PM |
Registered: 2 years ago Posts: 17 |
|
Re: Deprecating trigger_error calls in the Tarot cards? April 11, 2011 02:48PM |
Registered: 2 years ago Posts: 17 |
|
Re: Deprecating trigger_error calls in the Tarot cards? April 11, 2011 03:05PM |
Admin Registered: 6 years ago Posts: 2,639 |
I'll accept a patch that converts trigger_errors that are E_USER_ERROR can be converted to exceptions with no configuration flag. A patch that converts E_USER_WARNING trigger_errors to exceptions would be more interesting... in particular, a configuration flag won't necessarily work because a lot of this errors /come/ from the configuration handling system.