question about PEAR Error

From: Date: Thu, 23 Oct 2003 08:29:56 +0000
Subject: question about PEAR Error
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8550@lists.php.net to get a copy of this message
Hi, I was just wondering what the difference is between PEAR::raiseError() and returning a PEAR_Error object. Say for instance: function getName() { ....... if ($errors) {
      return new PEAR_Error('could not find name');
} else {
      return $name;
} } OR function getName() { ...... if ($errors) {
      PEAR::raiseError('could not find name');
} else {
      return $name;
} } Which one would be better? Are there cases in which one method is preferable? Thanks, Jeroen

« previous php.pear.general (#8550) next »