Module: REST::Error

Defined in:
lib/rest/error.rb

Overview

This constant can be used to rescue any of the known ‘Timeout`, `Connection`, and `Protocol` error classes.

For instance, to rescue any type of error that could be raise while making a request:

begin
  REST.get('http://example.com/pigeons/12')
rescue REST::Error => e
  p e # => Timeout::Error
end

If you want to rescue only ‘Timeout` related error classes, however, you can limit the scope:

begin
  REST.get('http://example.com/pigeons/12')
rescue REST::Error::Timeout => e
  p e # => Timeout::Error
end

Defined Under Namespace

Modules: Connection, Protocol, Timeout