ezmobius/redis-rb — pull request #176 by pietern (2012-02-01 23:53:53+00:00)
Title: Custom error classes

This patch adds more error classes, and defines them in `lib/redis/errors.rb`. An earlier proposal to move errors to this file was rejected, because there were only 2 custom errors at the time. This patch adds the custom connection related errors `ConnectionError` and `TimeoutError` which are raised when the connection could not be made or was lost, and times out respectively.

In addition, error replies are no longer of the type `Redis::Error` but `Redis::CommandError`. The `Redis::Error` type was introduced in code that has not been released, so should not result in compatibility issues.

The only backwards incompatible change that users need to be aware of is that they need to rescue from `ConnectionError` and `TimeoutError` instead of `Errno::ECONNRESET` and `Errno::EAGAIN`.

This fixes an (not **the**) issue discussed in #84.

@djanowski @soveran Can you check this out and comment?