From c97d14abe28cf418ed41ada85dd34325e6620c44 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 11 Aug 2023 17:10:17 +0100 Subject: [PATCH] move logger back into rescue block --- Gemfile.lock | 2 +- lib/obsws/req.rb | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8849b9f..095ce9e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - obsws (0.5.5) + obsws (0.5.6) waitutil (~> 0.2.1) websocket-driver (~> 0.7.5) diff --git a/lib/obsws/req.rb b/lib/obsws/req.rb index b03a0f0..b26f473 100644 --- a/lib/obsws/req.rb +++ b/lib/obsws/req.rb @@ -43,11 +43,12 @@ module OBSWS timeout_sec: 3 ) { @response[:requestId] == uuid } unless @response[:requestStatus][:result] - OBSWSRequestError.new(@response[:requestType], @response[:requestStatus][:code], @response[:requestStatus][:comment]) => e - logger.error(["#{e.class.name}: #{e.message}", *e.backtrace].join("\n")) - raise e + raise OBSWSRequestError.new(@response[:requestType], @response[:requestStatus][:code], @response[:requestStatus][:comment]) end @response[:responseData] + rescue OBSWSRequestError => e + logger.error(["#{e.class.name}: #{e.message}", *e.backtrace].join("\n")) + raise rescue WaitUtil::TimeoutError => e logger.error(["#{e.class.name}: #{e.message}", *e.backtrace].join("\n")) raise OBSWSError.new([e.message, *e.backtrace].join("\n"))