PHP Class Predis\CommunicationException

Author: Daniele Alessandri ([email protected])
Inheritance: extends PredisException
Show file Open project: nrk/predis Class Usage Examples

Public Methods

Method Description
__construct ( Predis\Connection\NodeConnectionInterface $connection, string $message = null, integer $code = null, Exception $innerException = null )
getConnection ( ) : Predis\Connection\NodeConnectionInterface Gets the connection that generated the exception.
handle ( CommunicationException $exception ) Helper method to handle exceptions generated by a connection object.
shouldResetConnection ( ) : boolean Indicates if the receiver should reset the underlying connection.

Method Details

__construct() public method

public __construct ( Predis\Connection\NodeConnectionInterface $connection, string $message = null, integer $code = null, Exception $innerException = null )
$connection Predis\Connection\NodeConnectionInterface Connection that generated the exception.
$message string Error message.
$code integer Error code.
$innerException Exception Inner exception for wrapping the original error.

getConnection() public method

Gets the connection that generated the exception.
public getConnection ( ) : Predis\Connection\NodeConnectionInterface
return Predis\Connection\NodeConnectionInterface

handle() public static method

Helper method to handle exceptions generated by a connection object.
public static handle ( CommunicationException $exception )
$exception CommunicationException Exception.

shouldResetConnection() public method

Indicates if the receiver should reset the underlying connection.
public shouldResetConnection ( ) : boolean
return boolean