nicolasff/phpredis — Issue #69: RedisArray, ping and stopped server - Fatal Error
Author: trong
Created: 2011-10-30 04:57:53+00:00
State: open

Hello,

Base code of test:

```php
$ra = RedisArray(array('127.0.0.1:6379'));
$ra->ping();
```

I'll get:

```php
array (
'127.0.0.1:6379' => '+PONG',
)
```

Ok, it's good. After that just stop redis server and rerun test code.

I'll get:

```php
PHP Fatal error: Redis::ping(): The object is not connected in .../RedisDB.php on line 81

Stack trace:
...
15. RedisArray->ping() .../RedisDB.php:81
```

It's fatal error and I can't catch this error type. I think in this case more usefull will be throw error of RedisException, not Fatal.

Something like this:

```php
$ra = RedisArray(array('127.0.0.1:6379'));

try {
$ra->ping();
} catch (RedisException $re) {
...
} catch (Exception $e) {
...
}
```