mirror of
https://github.com/predis/predis.git
synced 2026-10-23 04:06:23 +00:00
Augment exception message with basic server details on connection error.
Providing a basic hint in the exception message about the server that caused a connection exception could be useful especially with aggregated connections. This is in response to issue #110.
This commit is contained in:
@@ -136,7 +136,7 @@ abstract class AbstractConnection implements SingleConnectionInterface
|
||||
*/
|
||||
protected function onConnectionError($message, $code = null)
|
||||
{
|
||||
CommunicationException::handle(new ConnectionException($this, $message, $code));
|
||||
CommunicationException::handle(new ConnectionException($this, "$message [{$this->parameters->scheme}://{$this->getIdentifier()}]", $code));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ abstract class AbstractConnection implements SingleConnectionInterface
|
||||
*/
|
||||
protected function onProtocolError($message)
|
||||
{
|
||||
CommunicationException::handle(new ProtocolException($this, $message));
|
||||
CommunicationException::handle(new ProtocolException($this, "$message [{$this->parameters->scheme}://{$this->getIdentifier()}]"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user