Skip to content

Commit

Permalink
Include error message for enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Aug 7, 2024
1 parent 949da8b commit 5269522
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_indexer/test/enhancements_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5269522

Please sign in to comment.