Class: Yelp::Fusion::Error::ResponseValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/yelp/fusion/error.rb

Overview

Class to handle error responses

Instance Method Summary collapse

Instance Method Details

#validate(response) ⇒ Object

If the request is not successful, raise an appropriate Yelp::Error exception with the error text from the request response.

Parameters:

  • response

    from the Yelp API



33
34
35
36
37
# File 'lib/yelp/fusion/error.rb', line 33

def validate(response)
  return if successful_response?(response)

  raise error_from_response(response)
end