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
#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

#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.
Yii 2.0 Development Cookbook
Enjoying Yii? Star us at github
Support me so I can work more on Yii: https://www.patreon.com/samdark
Enjoying Yii? Star us at github
Support me so I can work more on Yii: https://www.patreon.com/samdark
Share this topic:
Page 1 of 1