RE: [PHP] error message handling

From: Date: Wed, 17 Jan 2001 19:13:39 +0000
Subject: RE: [PHP] error message handling
Groups: php.general 
Request: Send a blank email to php-general+get-35112@lists.php.net to get a copy of this message
You probably want to suppress the error message with an @ symbol. Try putting an "@" before the function calls that give you errors. <?php $x = @php_function_here(); ?> This suppresses the error function. Many functions return FALSE if unsuccessful, so you can test and supply your own error message. <?php if ($x == FALSE) { print ("error."); } ?> If you find yourself doing this alot, you may want to create a wrapper function or wrapper class around the original. Look at PHPLIB's DB_SQL class for an example of how they suppress error messages. Look at www.php.net for more info. -Ben -----Original Message----- From: Jason Jacobs [mailto:jason@factory7.com] Sent: Wednesday, January 17, 2001 10:23 AM To: php-general@lists.php.net Subject: [PHP] error message handling I tried to send this before, so if I did, forgive me, but I don't think it worked last time .:) I'm trying to find a way to handle errors by number. For example, if I get a "directory already exists" error, I want to know what the number that is so I can check the return value on the function that gave the error. That made no sense. Lemme try again. Instead of getting the php-generated error message, I want to create my own so the user has a nice message instead of one that makes it look like I don't know what I'm doing. :) Any suggestions? Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#35112) next »