From 0ae9e6e98ff20cc10984b86d211ac8508c303108 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 2 Mar 2009 21:45:19 -0700 Subject: [PATCH] Add server connect exception code. --- framework/Imap_Client/lib/Horde/Imap/Client/Exception.php | 3 +++ framework/Imap_Client/lib/Horde/Imap/Client/Socket.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Exception.php b/framework/Imap_Client/lib/Horde/Imap/Client/Exception.php index 00f2b26f8..07230f0d6 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Exception.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Exception.php @@ -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. diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php index 5d67e0006..88ab9de7d 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php @@ -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']); -- 2.11.0