Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8046 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96318 invoked by uid 1010); 22 Feb 2004 14:37:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 96273 invoked by uid 1007); 22 Feb 2004 14:37:21 -0000 Message-ID: <20040222143721.96272.qmail@pb1.pair.com> To: internals@lists.php.net Date: Sun, 22 Feb 2004 15:36:49 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: sv, en-us, en MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 213.132.107.228 Subject: PHP5: Exceptions must valid objects that are derived from class Exception? From: erik@nordicaudi.com (=?ISO-8859-1?Q?Erik_Franz=E9n?=) I am prototyping on a PHP5 application using PEAR and I ran into a strange error. if (PEAR::isError($mReturn)) { throw $mReturn; } PEAR is not configured to return exceptions instead of PEAR Errors and the above code will generate the following error if $mReturn is a PEAR Error. PHP Fatal error: Exceptions must valid objects that are derived from class Exception in E:\PHPSource\PHPFTP\Source\include\\db.inc.php on line 226 Why must I use the built in exception class? The explantion in release notes for PHPb4 is that it allows a general catch(Exception $e) statement to catch all exceptions. Isn't that up to the developer to deal with it? /Erik