public function shouldRetry(Exception $exception, $retryCount)
    {
        $message = $exception->getMessage();

        foreach (static::$causes as $cause) {
            if (strstr($message, $cause) !== false) {
                return $this->reconnect();
            }
        }

        return false;
    }
public function shouldRetry(Exception $exception, $retryCount)
    {
        $message = $exception->getMessage();

        foreach (static::$causes as $cause) {
            if (strstr($message, $cause) !== false) {
                return $this->reconnect();
            }
        }

        return false;
    }
public function shouldRetry ( Exception $ exception , $ retryCount ) { $ message = $ exception -> getMessage ( ) ; foreach ( static :: $ causes as $ cause ) { if ( strstr ( $ message , $ cause ) !== false ) { return $ this -> reconnect ( ) ; } } return false ; }
Checks whether or not the exception was caused by a lost connection,
and returns true if it was able to successfully reconnect.

@param Exception $exception The exception to check for its message
@param int $retryCount The number of times the action has been already called
@return bool Whether or not it is OK to retry the action
Checks whether or not the exception was caused by a lost connection and returns true if it was able to successfully reconnect .