From fb5495fad55c6590f1673af9616ee1109c94e6da Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Tue, 9 Nov 2010 18:58:29 -0200 Subject: [PATCH] Throws an exception on fail in connect. --- cake/libs/cake_socket.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cake/libs/cake_socket.php b/cake/libs/cake_socket.php index e07b9837f..612d42e21 100644 --- a/cake/libs/cake_socket.php +++ b/cake/libs/cake_socket.php @@ -100,6 +100,7 @@ class CakeSocket { * Connect the socket to the given host and port. * * @return boolean Success + * @throws Exception */ public function connect() { if ($this->connection != null) { @@ -119,6 +120,7 @@ class CakeSocket { if (!empty($errNum) || !empty($errStr)) { $this->setLastError($errStr, $errNum); + throw new Exception($errStr, $errNum); } $this->connected = is_resource($this->connection);