Method: Formstack::Client.handle_response

Defined in:
lib/formstack/client.rb

.handle_response(response) ⇒ Object



71
72
73
74
75
76
77
78
79
# File 'lib/formstack/client.rb', line 71

def self.handle_response(response)
  case response.code
  when 500...600; raise FormstackError.new(Hashie::Mash.new(response).error)
  else; response
  end
  
  Hashie::Mash.new(response).response
  
end