Re: Fatal Errors and Error Handling

From: Date: Tue, 24 Apr 2001 12:14:47 +0000
Subject: Re: Fatal Errors and Error Handling
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-50055@lists.php.net to get a copy of this message
Geir Eivind Mork wrote: > > > > > > http://www.php.net/manual/en/features.error-handling.php > > > have you taken a deeper look into this? > > Well, I have tried... > And what kind of problem did you encounter? The problem is that PHP generates fatal errors too often, and I have not been able to find a way of trapping them. It also means that I am not able to generate an error-message of the requiered form, e.g. something like <?xml version="1.0" encoding="UTF-8" ?> <my_reply> <my_error> Internal server error </my_error> </my_reply> What I do not need, is something like <br><b>Fatal error</b>: XML parser error 7: mismatched tag in <b>/var/www/[...] And returning nothing would be even worse. The messages are meant to be machine-readable, meaning we must comply with the standards. > but that, as far as I've understand your case, isn't a problem. Yes, it is. Because many functions generate fatal errors instead of simply returning false or generating a warning. I have tried using the set_error_handler(), but it only traps warnings and notices. It is possible that I am doing something wrong, so if you can give me a short working example, I should be really grateful! Svein Roar

« previous php.general (#50055) next »