Re: throwing an exception on failed require
| From: | Aidan Lister | Date: | Sat, 08 May 2004 12:06:48 +0000 |
| Subject: | Re: throwing an exception on failed require | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9734@lists.php.net to get a copy of this message | ||
Hehe, shut down Lukas.
I'd love to know why file_exists doesn't search the include path like every
other file function
"Derick Rethans" <derick@php.net> wrote in message
news:Pine.LNX.4.58.0405081253550.10150@localhost...
> 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