That just happened to me. Imagine a long running script writing to a database within a transaction. The script may time out or run out of memory, thus causing a PHP error that can't be catched within a try catch/block. Yes, one could manually define an error handler with set_error_handler but I guess this is something that could be built right into the core. What do you guys think? I like the idea of errors being treated as exceptions that can always be catched and handled.
Page 1 of 1
Throwing Exceptions When Php Errors/warnings Occur
#1
Posted 20 February 2013 - 07:46 AM
codecrumbs.at
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
#2
Posted 20 February 2013 - 10:32 AM
According to this page:
So, I think it's already implemented.
Quote
Ready December 26, 2012
yiic create (better yiic webapp).
Better validation (rules divided into rules and scenarios, removed safe and unsafe).
Better error handler (errors are converted to ErrorException).
yiic create (better yiic webapp).
Better validation (rules divided into rules and scenarios, removed safe and unsafe).
Better error handler (errors are converted to ErrorException).
So, I think it's already implemented.
#3
Posted 20 February 2013 - 11:19 AM
Ah, thanks Keith, didn't see that. Yet another point to look forward to Yii 2.0
Very nice. Hope the new handler can also be configured to throw exceptions on warnings (deprecated warnings etc.). I guess this could be useful too
codecrumbs.at
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
#4
Posted 20 February 2013 - 11:48 PM
Also Yii 2 will probably handle fatal errors. These, of course cannot be catched but at least it is possible to display these in a nice way and log using Yii router.
Share this topic:
Page 1 of 1

Help

This topic is locked












