lib/ezclient/request.rb in ezclient-0.5.0 vs lib/ezclient/request.rb in ezclient-0.6.0
- old
+ new
@@ -18,9 +18,19 @@
rescue => error
on_error.call(self, error, options[:metadata])
raise error
end
+ def perform!
+ response = perform
+
+ if response.error?
+ raise EzClient::ResponseStatusError, response
+ else
+ response
+ end
+ end
+
def api_auth!(*args)
raise "ApiAuth gem is not loaded" unless defined?(ApiAuth)
ApiAuth.sign!(http_request, *args)
self
end