logo       
Google Custom Search
    AddThis Social Bookmark Button

cvs: pear-core /PEAR Exception.php: msg#00384

Subject: cvs: pear-core /PEAR Exception.php
cellog          Fri Dec 31 14:01:06 2004 EDT

  Modified files:              
    /pear-core/PEAR     Exception.php 
  Log:
  fix #3061: potential warnings in PEAR_Exception
  
http://cvs.php.net/diff.php/pear-core/PEAR/Exception.php?r1=1.17&r2=1.18&ty=u
Index: pear-core/PEAR/Exception.php
diff -u pear-core/PEAR/Exception.php:1.17 pear-core/PEAR/Exception.php:1.18
--- pear-core/PEAR/Exception.php:1.17   Tue Oct 19 00:13:33 2004
+++ pear-core/PEAR/Exception.php        Fri Dec 31 14:01:05 2004
@@ -19,7 +19,7 @@
 // |          Greg Beaver <cellog@xxxxxxx>                                |
 // +----------------------------------------------------------------------+
 //
-// $Id: Exception.php,v 1.17 2004/10/19 04:13:33 cellog Exp $
+// $Id: Exception.php,v 1.18 2004/12/31 19:01:05 cellog Exp $
 
 
 /**
@@ -90,7 +90,7 @@
  *
  * @since PHP 5
  * @package PEAR
- * @version $Revision: 1.17 $
+ * @version $Revision: 1.18 $
  * @author Tomas V.V.Cox <cox@xxxxxxxxxxx>
  * @author Hans Lellelid <hans@xxxxxxxxx>
  * @author Bertrand Mansion <bmansion@xxxxxxxxxxx>
@@ -224,10 +224,17 @@
     public function getCauseMessage(&$causes)
     {
         $trace = $this->getTraceSafe();
-        $causes[] = array('class'   => get_class($this),
-                          'message' => $this->message,
-                          'file'    => $trace[0]['file'],
-                          'line'    => $trace[0]['line']);
+        $cause = array('class'   => get_class($this),
+                       'message' => $this->message,
+                       'file' => 'unknown',
+                       'line' => 'unknown');
+        if (isset($trace[0])) {
+            if (isset($trace[0]['file'])) {
+                $cause['file'] = $trace[0]['file'];
+                $cause['line'] = $trace[0]['line'];
+            }
+        }
+        $causes[] = $cause;
         if ($this->cause instanceof PEAR_Exception) {
             $this->cause->getCauseMessage($causes);
         }

-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>