Re: Fatal Errors and Error Handling
| From: | Christian Reiniger | Date: | Wed, 25 Apr 2001 12:09:33 +0000 |
| Subject: | Re: Fatal Errors and Error Handling | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50280@lists.php.net to get a copy of this message | ||
On Wednesday 25 April 2001 13:32, Svein Roar Nilsen wrote:
[...]
> This is quite similar to what I am trying. If you now corrupts the
> xmlData variable, e.g. by changing <article> to <rticl> without
> changing the closing tag, you will get an error message saying
>
> <br>
> <b>Fatal error</b>: XML parser error 7: mismatched tag in
> <b>/var/www/test.php</b> on line <b>40</b><br>
>
> As you can see here, xslt_process() dies with a fatal error and the
> program is terminated, and we never get to testing the return value.
[....]
> And in my opinion, there are too many things that can cause PHP to die
> with a fatal error. So we simply *must* be able to handle it and give a
> valid and reasonable error-message back.
Ok, agreed. I'd consider this a bug that should be submitted to
bugs.php.net
It's certainly not acceptable that code using xslt_process() has *no way*
of recovering from a (quite common) error. Corrupted data is something to
be expected, something that even has to be considered *normal* when
developing such a thing.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds