From f3b8e97d5a0b999c4c00cfa2732fbeff036d3950 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Tue, 1 Aug 2023 23:44:47 +0100 Subject: [PATCH] log kind error in entry method --- lib/voicemeeter/remote.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/voicemeeter/remote.rb b/lib/voicemeeter/remote.rb index 7e8f75b..ec84b9a 100644 --- a/lib/voicemeeter/remote.rb +++ b/lib/voicemeeter/remote.rb @@ -42,6 +42,8 @@ module Voicemeeter end module Remote + extend Logging + class Remote < Base # Concrete class for Remote types include Builder @@ -70,9 +72,8 @@ module Voicemeeter end end - class RemoteBasic < Remote - # Concrete class for RemoteBasic types - end + class RemoteBasic < Remote; end + # Concrete class for RemoteBasic types class RemoteBanana < Remote # Concrete class for RemoteBanana types @@ -111,7 +112,8 @@ module Voicemeeter def self.new(kind_id, **) # Interface entry point. Wraps factory class and handles kind errors. kind = Kinds.get(kind_id) - rescue KeyError + rescue KeyError => e + logger.error "#{e.class.name}: #{e.message}" raise Errors::VMError.new "unknown Voicemeeter kind #{kind_id}" else RequestRemote.for(kind, **)