<commit_before>module Fog
  module DNS
    class DNSimple
      class Real

        # Gets record from given domain.
        #
        # ==== Parameters
        # * domain<~String>
        # * record_id<~String>
        # ==== Returns
        # * response<~Excon::Response>:
        #   * record<~Hash>
        #     * name<~String>
        #     * ttl<~Integer>
        #     * created_at<~String>
        #     * special_type<~String>
        #     * updated_at<~String>
        #     * domain_id<~Integer>
        #     * id<~Integer>
        #     * content<~String>
        #     * record_type<~String>
        #     * prio<~Integer>
        def get_record(domain, record_id)

          request( :expects  => 200,
                   :method   => "GET",
                   :path     => "/domains/#{domain}/records/#{record_id}" )
        end

      end

      class Mock

        def get_record(domain, record_id)
          response = Excon::Response.new
          if self.data[:records].has_key? domain
            response.status = 200
            response.body = self.data[:records][domain].detect { |record| record["record"]["id"] == record_id }
          else
            response.status = 404
          end
          response
        end
      end
    end
  end
end<commit_msg>Add proper error message to 404<commit_after>module Fog
  module DNS
    class DNSimple
      class Real

        # Gets record from given domain.
        #
        # ==== Parameters
        # * domain<~String>
        # * record_id<~String>
        # ==== Returns
        # * response<~Excon::Response>:
        #   * record<~Hash>
        #     * name<~String>
        #     * ttl<~Integer>
        #     * created_at<~String>
        #     * special_type<~String>
        #     * updated_at<~String>
        #     * domain_id<~Integer>
        #     * id<~Integer>
        #     * content<~String>
        #     * record_type<~String>
        #     * prio<~Integer>
        def get_record(domain, record_id)

          request( :expects  => 200,
                   :method   => "GET",
                   :path     => "/domains/#{domain}/records/#{record_id}" )
        end

      end

      class Mock

        def get_record(domain, record_id)
          response = Excon::Response.new
          if self.data[:records].has_key? domain
            response.status = 200
            response.body = self.data[:records][domain].detect { |record| record["record"]["id"] == record_id }
          else
            response.status = 404
            response.body = {
              "error" => "Couldn't find Domain with name = #{domain}"
            }
          end
          response
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.12305986696230599, 'fraction_numerical': 0.007760532150776054, 'mean_word_length': 1.4431407942238268, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3095955', 'n_tokens_mistral': 817, 'n_tokens_neox': 775, 'n_words': 148}