We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c4a954 commit 178c661Copy full SHA for 178c661
README.md
@@ -158,6 +158,26 @@ end
158
# => 1
159
```
160
161
+## Error Handling
162
+
163
+In general, if something goes wrong you'll get an exception. For example, if
164
+it can't connect to the server a `Redis::CannotConnectError` error will be raised.
165
166
+```ruby
167
+begin
168
+ redis.ping
169
+rescue Exception => e
170
+ e.inspect
171
+# => #<Redis::CannotConnectError: Timed out connecting to Redis on 10.0.1.1:6380>
172
173
+ e.message
174
+# => Timed out connecting to Redis on 10.0.1.1:6380
175
+end
176
+```
177
178
+See lib/redis/errors.rb for information about what exceptions are possible.
179
180
181
## Expert-Mode Options
182
183
- `inherit_socket: true`: disable safety check that prevents a forked child
0 commit comments