lib/gemirro/http.rb in gemirro-1.2.0 vs lib/gemirro/http.rb in gemirro-1.3.0

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + module Gemirro ## # The Http class is responsible for executing GET request # to a specific url and return an response as an HTTP::Message # @@ -16,12 +18,10 @@ # @return [HTTP::Message] # def self.get(url) response = client.get(url, follow_redirect: true) - unless HTTP::Status.successful?(response.status) - raise HTTPClient::BadResponseError, response.reason - end + raise HTTPClient::BadResponseError, response.reason unless HTTP::Status.successful?(response.status) response end ##