diff --git a/lib/oktakit/response/raise_error.rb b/lib/oktakit/response/raise_error.rb index 9175be2..5837a48 100644 --- a/lib/oktakit/response/raise_error.rb +++ b/lib/oktakit/response/raise_error.rb @@ -7,6 +7,8 @@ module Response # This class raises an Oktakit-flavored exception based # HTTP status codes returned by the API class RaiseError < Faraday::Response::Middleware + private + def on_complete(response) if (error = Oktakit::Error.from_response(response)) raise error