Skip to content

Commit

Permalink
Updated beanstalk service to throw exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Wilde committed Apr 24, 2014
1 parent 4815352 commit 80716b4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions net/beanstalk/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use lithium\core\Libraries;
use lithium\core\ClassNotFoundException;
use lithium\core\NetworkException;

class Service extends \lithium\core\Object {

Expand Down Expand Up @@ -58,8 +59,12 @@ public function connect() {
$config = $this->_config;

if(!$this->_isConnected) {
if($this->connection->open($config)) {
$this->_isConnected = true;
try {
if($this->connection->open($config)) {
$this->_isConnected = true;
}
} catch (NetworkException $e) {
throw new NetworkException("Unable to connect to Beanstalk");
}
}
return $this->_isConnected;
Expand Down

0 comments on commit 80716b4

Please sign in to comment.