lib/jets/api/core.rb in jets-api-0.1.2 vs lib/jets/api/core.rb in jets-api-0.1.3
- old
+ new
@@ -64,13 +64,14 @@
puts "Jets API #{url}" if ENV['JETS_API_DEBUG']
raise "Jets API called failed: #{uri.host}"
end
end
- # Note: 422 is Unprocessable Entity. This means an invalid data payload was sent.
- # We want that to error and raise
+ # 422 Unprocessable Entity: Server understands the content type of the request entity, and
+ # the syntax of the request entity is correct, but it was unable to process the contained
+ # instructions.
def processable?(http_code)
- http_code =~ /^20/ || http_code =~ /^40/
+ http_code =~ /^2/ || http_code =~ /^4/
end
def http
uri = URI(endpoint)
http = Net::HTTP.new(uri.host, uri.port)