lib/zeppelin/middleware.rb in zeppelin-0.8.3 vs lib/zeppelin/middleware.rb in zeppelin-0.8.4
- old
+ new
@@ -3,6 +3,11 @@
end
end
require 'zeppelin/middleware/response_raise_error'
-Faraday.register_middleware :response, zeppelin_raise_error: Zeppelin::Middleware::ResponseRaiseError
+# For backwards compatibility with Faraday < 0.9
+if Faraday.respond_to?(:register_middleware)
+ Faraday.register_middleware :response, zeppelin_raise_error: Zeppelin::Middleware::ResponseRaiseError
+else
+ Faraday::Response.register_middleware zeppelin_raise_error: Zeppelin::Middleware::ResponseRaiseError
+end