phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] [20901] Bug fix : Enable throwing of exceptions.


From: Sigurd Nes
Subject: [Phpgroupware-cvs] [20901] Bug fix : Enable throwing of exceptions.
Date: Mon, 30 Nov 2009 17:28:53 +0000

Revision: 20901
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=20901
Author:   sigurdne
Date:     2009-11-30 17:28:53 +0000 (Mon, 30 Nov 2009)
Log Message:
-----------
Bug fix : Enable throwing of exceptions. Solves problem with ugly error 
messages displayed to the end user.

Modified Paths:
--------------
    people/sigurdne/modules/phpgwapi/trunk/inc/class.mailer_smtp.inc.php
    people/sigurdne/modules/phpgwapi/trunk/inc/class.send.inc.php

Modified: people/sigurdne/modules/phpgwapi/trunk/inc/class.mailer_smtp.inc.php
===================================================================
--- people/sigurdne/modules/phpgwapi/trunk/inc/class.mailer_smtp.inc.php        
2009-11-25 18:58:41 UTC (rev 20900)
+++ people/sigurdne/modules/phpgwapi/trunk/inc/class.mailer_smtp.inc.php        
2009-11-30 17:28:53 UTC (rev 20901)
@@ -28,6 +28,7 @@
                */
                public function __construct()
                {
+                       parent::__construct(true); // enable exceptions
                        $this->IsSMTP(true);
                        $this->Host = 
$GLOBALS['phpgw_info']['server']['smtp_server'];
                        $this->Port = 
isset($GLOBALS['phpgw_info']['server']['smtp_port']) ? 
$GLOBALS['phpgw_info']['server']['smtp_port'] : 25;

Modified: people/sigurdne/modules/phpgwapi/trunk/inc/class.send.inc.php
===================================================================
--- people/sigurdne/modules/phpgwapi/trunk/inc/class.send.inc.php       
2009-11-25 18:58:41 UTC (rev 20900)
+++ people/sigurdne/modules/phpgwapi/trunk/inc/class.send.inc.php       
2009-11-30 17:28:53 UTC (rev 20901)
@@ -189,11 +189,17 @@
                        // set a higher timeout for big messages
                        @set_time_limit(120);
                        #$smtp->SMTPDebug = 10;
-                       if(!$smtp->Send())
+                       try
                        {
+                               $smtp->Send();
+                       }
+                       catch (phpmailerException $e)
+                       {
                                $this->errorInfo = $smtp->ErrorInfo;
+                               throw $e;
                                return false;
                        }
+
                        return true;
                }
        





reply via email to

[Prev in Thread] Current Thread [Next in Thread]