diff options
| author | Yusuke Endoh <mame@ruby-lang.org> | 2025-12-17 13:26:55 +0900 |
|---|---|---|
| committer | Yusuke Endoh <mame@ruby-lang.org> | 2025-12-17 21:11:27 +0900 |
| commit | aee4b24829cfd26c9089f539179bd7770d283bfa (patch) | |
| tree | cdb2ead12c5925707009b0daf4f2adc800687eb2 /lib | |
| parent | c99670d6683fec770271d35c2ae082514b1abce3 (diff) | |
[ruby/error_highlight] Show no message when failing to get caller/callee snippets
Even with Ruby 4.0, snippets is not always available, such as in irb by
default. It would be better to just say nothing than to show a confusing
message.
https://github.com/ruby/error_highlight/commit/ef80ce73a1
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/error_highlight/core_ext.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/error_highlight/core_ext.rb b/lib/error_highlight/core_ext.rb index 1cfc331582..c3354f46cd 100644 --- a/lib/error_highlight/core_ext.rb +++ b/lib/error_highlight/core_ext.rb @@ -24,7 +24,7 @@ module ErrorHighlight _, _, snippet, highlight = ErrorHighlight.formatter.message_for(spot).lines out += "\n | #{ snippet } #{ highlight }" else - out += "\n (cannot highlight method definition; try Ruby 4.0 or later)" + # do nothing end end ret << "\n" + out if out |
