raise appropriate error message if .plugin called with odd second parameter

This commit is contained in:
HoneyryderChuck 2021-06-26 15:49:00 +03:00
parent 9c62f46189
commit b00f8575d7

View File

@ -171,6 +171,8 @@ module HTTPX
end
def merge(other)
raise ArgumentError, "#{other.inspect} is not a valid set of options" unless other.respond_to?(:to_hash)
h2 = other.to_hash
return self if h2.empty?