Skip to content

Commit

Permalink
Throws an exception on fail in connect.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Nov 9, 2010
1 parent b46b861 commit fb5495f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cake/libs/cake_socket.php
Expand Up @@ -100,6 +100,7 @@ function __construct($config = array()) {
* Connect the socket to the given host and port.
*
* @return boolean Success
* @throws Exception
*/
public function connect() {
if ($this->connection != null) {
Expand All @@ -119,6 +120,7 @@ public function connect() {

if (!empty($errNum) || !empty($errStr)) {
$this->setLastError($errStr, $errNum);
throw new Exception($errStr, $errNum);
}

$this->connected = is_resource($this->connection);
Expand Down

0 comments on commit fb5495f

Please sign in to comment.