Re: Re: [RFC] Autoloader Error Handling
| From: | Christian Kaps | Date: | Fri, 25 Nov 2011 08:06:33 +0000 |
| Subject: | Re: Re: [RFC] Autoloader Error Handling | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56615@lists.php.net to get a copy of this message | ||
Am 25.11.2011 08:24, schrieb Michael Wallner:
On Thu, 24 Nov 2011 23:28:35 +0100, Christian Kaps wrote:Hi, how would you bring your application in a consistent state after a class couldn't be loaded. I do this by adding a try/catch block around my code. try {https://wiki.php.net/rfc/autoloader_error_handlingThrowing an exception or fatal error in an autoloader absolutely does not make any sense in my eyes. Projects doing this should step back and think a minute about what they dare. Mike
new Application();} catch (Exception) {
// collect data
// send mail
// redirect to maintenance page
}
An other question is, if the autoloader work silent and I write:
new NotExistingClass();
I think in this case the engine will also trigger a fatal error. So in my eyes it is regardless of whether it trigger a fatal error in the autoloader or the autoloader works silent. Both cases ends in a fatal error. Or am i wrong here?
Christian