From f4be09be2a594ebc6b1e170c70ccb946b23865d4 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Wed, 2 Aug 2023 00:14:17 +0100 Subject: [PATCH] include backtrace in error log --- lib/voicemeeter/cbindings.rb | 6 +++++- lib/voicemeeter/install.rb | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/voicemeeter/cbindings.rb b/lib/voicemeeter/cbindings.rb index febd2c3..52048ed 100644 --- a/lib/voicemeeter/cbindings.rb +++ b/lib/voicemeeter/cbindings.rb @@ -74,7 +74,11 @@ module Voicemeeter end res rescue Errors::VMCAPIError => e - logger.error "#{e.class.name}: #{e.message}" + err_msg = [ + "#{e.class.name}: #{e.message}", + *e.backtrace + ] + logger.error err_msg.join("\n") raise end diff --git a/lib/voicemeeter/install.rb b/lib/voicemeeter/install.rb index 441cbea..752343c 100644 --- a/lib/voicemeeter/install.rb +++ b/lib/voicemeeter/install.rb @@ -32,7 +32,11 @@ module Voicemeeter Pathname.new(value).dirname end rescue Win32::Registry::Error => e - logger.error "#{e.class.name}: #{e.message}" + err_msg = [ + "#{e.class.name}: #{e.message}", + *e.backtrace + ] + logger.error err_msg.join("\n") raise Errors::VMInstallError.new "unable to read Voicemeeter path from the registry" end