From 5269522c4b730bca0afb2248848c764f11c49277 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Wed, 7 Aug 2024 16:11:08 -0400 Subject: [PATCH] Include error message for enhancements --- lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb | 4 ++-- lib/ruby_indexer/test/enhancements_test.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb b/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb index 327c96fee..53c37a172 100644 --- a/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb +++ b/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb @@ -293,8 +293,8 @@ def on_call_node_enter(node) @enhancements.each do |enhancement| enhancement.on_call_node(@index, @owner_stack.last, node, @file_path) - rescue StandardError - @indexing_errors << "Error occurred when indexing #{@file_path} with '#{enhancement.class.name}' enhancement" + rescue StandardError => e + @indexing_errors << "Indexing error in #{@file_path} with '#{enhancement.class.name}' enhancement: #{e.message}" end end diff --git a/lib/ruby_indexer/test/enhancements_test.rb b/lib/ruby_indexer/test/enhancements_test.rb index ba3101205..df33ff568 100644 --- a/lib/ruby_indexer/test/enhancements_test.rb +++ b/lib/ruby_indexer/test/enhancements_test.rb @@ -189,7 +189,7 @@ def self.extended(base) RUBY end - assert_match(%r{Error occurred when indexing /fake/path/foo\.rb with 'TestEnhancement' enhancement}, stderr) + assert_match(%r{Indexing error in /fake/path/foo\.rb with 'TestEnhancement' enhancement}, stderr) # The module should still be indexed assert_entry("ActiveSupport::Concern", Entry::Module, "/fake/path/foo.rb:1-2:5-5") end