diff --git a/plugins/commands/serve/service/capability_platform_service.rb b/plugins/commands/serve/service/capability_platform_service.rb index 66a074849..2362cbe54 100644 --- a/plugins/commands/serve/service/capability_platform_service.rb +++ b/plugins/commands/serve/service/capability_platform_service.rb @@ -11,7 +11,7 @@ module VagrantPlugins klass.prepend(Util::HasMapper) klass.prepend(Util::HasBroker) klass.prepend(Util::HasLogger) - klass.include(Util::ExceptionLogger) + klass.include(Util::ExceptionTransformer) klass.class_eval do attr_reader :capabilities, :default_args diff --git a/plugins/commands/serve/service/command_service.rb b/plugins/commands/serve/service/command_service.rb index 587cc336d..b346db13d 100644 --- a/plugins/commands/serve/service/command_service.rb +++ b/plugins/commands/serve/service/command_service.rb @@ -10,7 +10,7 @@ module VagrantPlugins prepend Util::HasMapper prepend Util::HasBroker prepend Util::HasLogger - include Util::ExceptionLogger + include Util::ExceptionTransformer def command_info_spec(*args) SDK::FuncSpec.new diff --git a/plugins/commands/serve/service/communicator_service.rb b/plugins/commands/serve/service/communicator_service.rb index 4fc5e4285..7890fa4ff 100644 --- a/plugins/commands/serve/service/communicator_service.rb +++ b/plugins/commands/serve/service/communicator_service.rb @@ -10,7 +10,7 @@ module VagrantPlugins prepend Util::HasBroker prepend Util::HasLogger include Util::HasSeeds::Service - include Util::ExceptionLogger + include Util::ExceptionTransformer def initialize(*args, **opts, &block) super() diff --git a/plugins/commands/serve/service/internal_service.rb b/plugins/commands/serve/service/internal_service.rb index 205f4d756..07b35e807 100644 --- a/plugins/commands/serve/service/internal_service.rb +++ b/plugins/commands/serve/service/internal_service.rb @@ -12,7 +12,7 @@ module VagrantPlugins class InternalService < Hashicorp::Vagrant::RubyVagrant::Service prepend Util::HasBroker prepend Util::HasLogger - include Util::ExceptionLogger + include Util::ExceptionTransformer def get_plugins(req, _unused_call) plugins = [] diff --git a/plugins/commands/serve/service/provider_service.rb b/plugins/commands/serve/service/provider_service.rb index 38797bd05..3760989b2 100644 --- a/plugins/commands/serve/service/provider_service.rb +++ b/plugins/commands/serve/service/provider_service.rb @@ -12,7 +12,7 @@ module VagrantPlugins prepend Util::HasMapper prepend Util::HasBroker prepend Util::HasLogger - include Util::ExceptionLogger + include Util::ExceptionTransformer def usable(req, _unused_call) nil diff --git a/plugins/commands/serve/util.rb b/plugins/commands/serve/util.rb index 6db49ab74..e211f24cb 100644 --- a/plugins/commands/serve/util.rb +++ b/plugins/commands/serve/util.rb @@ -4,7 +4,7 @@ module VagrantPlugins autoload :Cacher, Vagrant.source_root.join("plugins/commands/serve/util/cacher").to_s autoload :ClientSetup, Vagrant.source_root.join("plugins/commands/serve/util/client_setup").to_s autoload :Connector, Vagrant.source_root.join("plugins/commands/serve/util/connector").to_s - autoload :ExceptionLogger, Vagrant.source_root.join("plugins/commands/serve/util/exception_logger").to_s + autoload :ExceptionTransformer, Vagrant.source_root.join("plugins/commands/serve/util/exception_transformer").to_s autoload :HasBroker, Vagrant.source_root.join("plugins/commands/serve/util/has_broker").to_s autoload :HasLogger, Vagrant.source_root.join("plugins/commands/serve/util/has_logger").to_s autoload :HasMapper, Vagrant.source_root.join("plugins/commands/serve/util/has_mapper").to_s diff --git a/plugins/commands/serve/util/exception_logger.rb b/plugins/commands/serve/util/exception_transformer.rb similarity index 83% rename from plugins/commands/serve/util/exception_logger.rb rename to plugins/commands/serve/util/exception_transformer.rb index aed93d26a..db0522e9f 100644 --- a/plugins/commands/serve/util/exception_logger.rb +++ b/plugins/commands/serve/util/exception_transformer.rb @@ -2,7 +2,7 @@ module VagrantPlugins module CommandServe module Util # Adds exception logging to all public instance methods - module ExceptionLogger + module ExceptionTransformer prepend Util::HasMapper def self.included(klass) @@ -26,7 +26,6 @@ module VagrantPlugins locale: "en-US", message: err.message ) ) - proto = Google::Rpc::Status.new( code: GRPC::Core::StatusCodes::UNKNOWN, message: "#{err.message}\n#{err.backtrace.join("\n")}", @@ -39,14 +38,6 @@ module VagrantPlugins err.message, {grpc_status_details_bin_trailer => encoded_proto}, ) - - if self.respond_to?(:logger) - # logger.error(err.message) - # logger.debug("#{err.class}: #{err}\n#{err.backtrace.join("\n")}") - logger.debug("status: #{grpc_error.to_status}") - logger.debug("rpc status: #{grpc_error.to_rpc_status}") - end - raise grpc_error end end