From 3c4b2c8bbadf3073dae7d4f806f89c46d51ff41b Mon Sep 17 00:00:00 2001 From: Julien Liabeuf Date: Thu, 9 Jul 2015 11:29:31 +0700 Subject: [PATCH] Show error message when connection fails This makes debugging so much easier. Just seeing *There was an error connecting to the server* doesn't help at all. --- fMailbox.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fMailbox.php b/fMailbox.php index 7ccf4e42..426330c0 100644 --- a/fMailbox.php +++ b/fMailbox.php @@ -978,7 +978,7 @@ private function connect() } if (!$this->connection) { - throw new fConnectivityException('There was an error connecting to the server'); + throw new fConnectivityException( sprintf('Error %d: %s'), $error_number, $error_string ); } stream_set_timeout($this->connection, $this->timeout); @@ -1522,4 +1522,4 @@ private function write($command, $expected=NULL) * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. - */ \ No newline at end of file + */