Add server connect exception code.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 3 Mar 2009 04:45:19 +0000 (21:45 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 3 Mar 2009 04:45:19 +0000 (21:45 -0700)
framework/Imap_Client/lib/Horde/Imap/Client/Exception.php
framework/Imap_Client/lib/Horde/Imap/Client/Socket.php

index 00f2b26..07230f0 100644 (file)
@@ -53,6 +53,9 @@ class Horde_Imap_Client_Exception extends Exception
     // Thrown if the cache has become invalid.
     const CACHEUIDINVALID = 11;
 
+    // Thrown if server denies the network connection.
+    const SERVER_CONNECT = 12;
+
     /**
      * Define a callback function used to log the exception. Will be passed
      * a single parameter - a copy of this object.
index 5d67e00..88ab9de 100644 (file)
@@ -425,7 +425,7 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
         if ($this->_stream === false) {
             $this->_stream = null;
             $this->_isSecure = false;
-            throw new Horde_Imap_Client_Exception('Error connecting to IMAP server: [' . $error_number . '] ' . $error_string);
+            throw new Horde_Imap_Client_Exception('Error connecting to IMAP server: [' . $error_number . '] ' . $error_string, Horde_Imap_Client_Exception::SERVER_CONNECT);
         }
 
         stream_set_timeout($this->_stream, $this->_params['timeout']);