Re: throwing an exception on failed require
| From: | Derick Rethans | Date: | Sat, 08 May 2004 10:58:17 +0000 |
| Subject: | Re: throwing an exception on failed require | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9732@lists.php.net to get a copy of this message | ||
On Sat, 8 May 2004, Lukas Smith wrote:
> I think it would be useful if require would throw an exception on failure.
NO! Internal functions do NOT throw exceptions, period.
> By throwing an exception inside require with the necessary information
> it would be able to cleanly handle this situation without having to
> silence this error and then parsing the error message. And it would
> obviously be BC compatible as uncaught exceptions are fatal.
A require should fail if it can't find the file, no nice handling as
it's CLEARLY a programmers error.
regards,
Derick