lib/wp/hmac/client.rb in wp-hmac-0.2.4 vs lib/wp/hmac/client.rb in wp-hmac-0.2.5

- old
+ new

@@ -41,10 +41,13 @@ # client = WP::HMAC::Client.new('https://www.example.com') # client.get('api/staff') %i(delete get head options post put patch).each do |method| define_method(method) do |*args| response = @client.send(method, *args) - fail UnsuccessfulResponse unless /2\d\d/.match("#{response.status}") + fail( + UnsuccessfulResponse, + "#{response.status} - #{response.headers} - #{response.body}" + ) unless /2\d\d/.match("#{response.status}") response end end # Supports: