Sha256: 95b6c26b80831b66f6aeb549a2a2db8d21c961d3fe1dded2caf0c4614a3f0173
Contents?: true
Size: 517 Bytes
Versions: 28
Compression:
Stored size: 517 Bytes
Contents
require "faraday" module Faraday class UnexpectedResponse < RuntimeError attr_reader :response def initialize(response) @response = response super "Unexpected response (#{response.status}) from #{response.env[:url].host}#{response.env[:url].path}" end end module Expect def expect!(*status_codes) return if status_codes.include?(status) fail UnexpectedResponse.new(self) end alias :must_be! :expect! end end Faraday::Response.send :include, Faraday::Expect
Version data entries
28 entries across 28 versions & 1 rubygems