Class: CodewarsApi::ResponseChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/codewars_api/helpers/response_checker.rb

Class Method Summary collapse

Class Method Details

.check_errors(response) ⇒ Object



3
4
5
6
7
# File 'lib/codewars_api/helpers/response_checker.rb', line 3

def self.check_errors(response)
  unless response.code.to_i == 200
    raise "Response code is '#{response.code}'\n#{response.message}"
  end
end