Module: ApiConsumer::ErrorHandler

Included in:
Base::ClassMethods
Defined in:
lib/api_consumer/error_handler.rb

Instance Method Summary collapse

Instance Method Details

#find(*attributes) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/api_consumer/error_handler.rb', line 3

def find(*attributes)
  scope = attributes.slice(0)
  if scope == :all
    begin
      super(*attributes)
    rescue ActiveResource::ConnectionError, ActiveResource::ClientError
      []
    end
  else
    super(*attributes)
  end
end