move logger back into rescue block

This commit is contained in:
onyx-and-iris 2023-08-11 17:10:17 +01:00
parent 123b9c55ca
commit c97d14abe2
2 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,7 @@
PATH PATH
remote: . remote: .
specs: specs:
obsws (0.5.5) obsws (0.5.6)
waitutil (~> 0.2.1) waitutil (~> 0.2.1)
websocket-driver (~> 0.7.5) websocket-driver (~> 0.7.5)

View File

@ -43,11 +43,12 @@ module OBSWS
timeout_sec: 3 timeout_sec: 3
) { @response[:requestId] == uuid } ) { @response[:requestId] == uuid }
unless @response[:requestStatus][:result] unless @response[:requestStatus][:result]
OBSWSRequestError.new(@response[:requestType], @response[:requestStatus][:code], @response[:requestStatus][:comment]) => e raise OBSWSRequestError.new(@response[:requestType], @response[:requestStatus][:code], @response[:requestStatus][:comment])
logger.error(["#{e.class.name}: #{e.message}", *e.backtrace].join("\n"))
raise e
end end
@response[:responseData] @response[:responseData]
rescue OBSWSRequestError => e
logger.error(["#{e.class.name}: #{e.message}", *e.backtrace].join("\n"))
raise
rescue WaitUtil::TimeoutError => e rescue WaitUtil::TimeoutError => e
logger.error(["#{e.class.name}: #{e.message}", *e.backtrace].join("\n")) logger.error(["#{e.class.name}: #{e.message}", *e.backtrace].join("\n"))
raise OBSWSError.new([e.message, *e.backtrace].join("\n")) raise OBSWSError.new([e.message, *e.backtrace].join("\n"))