mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-22 01:40:49 +00:00
refactor call
This commit is contained in:
parent
f3b8e97d5a
commit
9ed21ffc38
@ -65,16 +65,17 @@ module Voicemeeter
|
|||||||
res = send(fn, *args)
|
res = send(fn, *args)
|
||||||
if exp
|
if exp
|
||||||
unless exp.call(res) || ok.include?(res)
|
unless exp.call(res) || ok.include?(res)
|
||||||
logger.error "#{to_cname.call} returned #{res}"
|
|
||||||
raise Errors::VMCAPIError.new to_cname.call, res
|
raise Errors::VMCAPIError.new to_cname.call, res
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
unless ok.include?(res)
|
unless ok.include?(res)
|
||||||
logger.error "#{to_cname.call} returned #{res}"
|
|
||||||
raise Errors::VMCAPIError.new to_cname.call, res
|
raise Errors::VMCAPIError.new to_cname.call, res
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
res
|
res
|
||||||
|
rescue Errors::VMCAPIError => e
|
||||||
|
logger.error "#{e.class.name}: #{e.message}"
|
||||||
|
raise
|
||||||
end
|
end
|
||||||
|
|
||||||
module_function :call
|
module_function :call
|
||||||
|
Loading…
Reference in New Issue
Block a user