From 3b02b32276fab70e21a017d62ec9eea67996a906 Mon Sep 17 00:00:00 2001 From: Lawson Jaglom-Kurtz Date: Thu, 13 Jan 2022 15:07:48 -0700 Subject: [PATCH] Make Oktakit::Response::RaiseError#on_complete public A respond_to? guard clause in Faraday::Middleware prevents this callback from ever executing when the method is private. See https://github.com/lostisland/faraday/blob/main/lib/faraday/middleware.rb#L18 --- lib/oktakit/response/raise_error.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/oktakit/response/raise_error.rb b/lib/oktakit/response/raise_error.rb index 5837a48..9175be2 100644 --- a/lib/oktakit/response/raise_error.rb +++ b/lib/oktakit/response/raise_error.rb @@ -7,8 +7,6 @@ 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