Re: new push/pop error handlings

From: Date: Sun, 29 Jul 2001 03:19:01 +0000
Subject: Re: new push/pop error handlings
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-1107@lists.php.net to get a copy of this message
"Tomas V.V.Cox" wrote: > > yavor shahpasov wrote: > > > > This is very cool and maybe I'm missing a bit on the discussion, but > > shouldn't it be integrated into the current raseError functionality, maybe > > if the error is not displayed push it to the error stack and set a > > errorOccured flag. Then each getMessage would pop it out. > > > > Yes, this was discussed also. My idea was to provide a method to raise > the error contained in a error object. > > $this->pushErrorHandler(PEAR_ERROR_RETURN); > $error = $db->query(..); > $this->popErrorHandlier(); > if (DB::isError($error)) { > // this will act much similar as > // $this->raiseError($error->getMessage()); > return $this->raiseErrorObj($error); > } > > Other ideas? Why can't raiseError() just do an isError test on its first parameter and just use it as-is if it is an error object already? - Stig

« previous php.pear.dev (#1107) next »