lib/determinator/retrieve/http_retriever.rb in determinator-2.3.0 vs lib/determinator/retrieve/http_retriever.rb in determinator-2.3.1

- old
+ new

@@ -8,16 +8,15 @@ raise ArgumentError, "client must be a Faraday::Connection" unless connection.is_a?(Faraday::Connection) @connection = connection end def retrieve(name) - begin - response = @connection.get("/features/#{name}") - return Determinator::Serializers::JSON.load(response.body) if response.status == 200 - rescue => e - Determinator.notice_error(e) - end - nil + response = @connection.get("/features/#{name}") + return Determinator::Serializers::JSON.load(response.body) if response.status == 200 + return MissingResponse.new if response.status == 404 + rescue => e + Determinator.notice_error(e) + ErrorResponse.new end # Returns a feature name given a actor-tracking url. Used so we are able # to expire a cache using a feature name given an event url. #