[ 
https://issues.apache.org/jira/browse/HBASE-26880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17515295#comment-17515295
 ] 

Peter Somogyi commented on HBASE-26880:
---------------------------------------

This is indeed caused by HBASE-26741. I managed to fix it with a naive solution 
but it should be checked if there are any better solutions as I'm not a ruby 
expert.
{code:java}
diff --git a/hbase-shell/src/main/ruby/irb/hirb.rb 
b/hbase-shell/src/main/ruby/irb/hirb.rb
index 9a81f5abc7..4ce60325d2 100644
--- a/hbase-shell/src/main/ruby/irb/hirb.rb
+++ b/hbase-shell/src/main/ruby/irb/hirb.rb
@@ -117,6 +117,8 @@ module IRB
           rescue Interrupt => exc
           rescue SystemExit, SignalException
             raise
+          rescue NameError => exc
+            # Ignored
           rescue Exception
             # HBASE-26741: Raise exception so Shell::exception_handler can 
catch it.
             # This modifies this copied method from JRuby so that the HBase 
shell can {code}

> Misspelling commands in hbase shell will crash the shell
> --------------------------------------------------------
>
>                 Key: HBASE-26880
>                 URL: https://issues.apache.org/jira/browse/HBASE-26880
>             Project: HBase
>          Issue Type: Bug
>          Components: shell
>    Affects Versions: 2.4.10
>            Reporter: Evan Krettek
>            Priority: Minor
>
> Misspelling commands in hbase shell will crash the shell, e.g.
> hbase:001:0> hlep
> NameError: undefined local variable or method `hlep' for 
> #<HBaseReceiver:0x1610c03c>
> Did you mean?  help
>                   evaluate at (hbase):1
>                       eval at org/jruby/RubyKernel.java:1048
>                   evaluate at 
> uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb/workspace.rb:85
>                   evaluate at 
> uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb/context.rb:380
>                 eval_input at uri:classloader:/irb/hirb.rb:112
>              signal_status at 
> uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb.rb:623
>                 eval_input at uri:classloader:/irb/hirb.rb:109
>   each_top_level_statement at 
> uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb/ruby-lex.rb:246
>                       loop at org/jruby/RubyKernel.java:1442
>   each_top_level_statement at 
> uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb/ruby-lex.rb:232
>                      catch at org/jruby/RubyKernel.java:1189
>   each_top_level_statement at 
> uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb/ruby-lex.rb:231
>                 eval_input at uri:classloader:/irb/hirb.rb:108
>                        run at 
> uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb.rb:428
>                      catch at org/jruby/RubyKernel.java:1189
>                        run at 
> uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb.rb:427
>                     <main> at classpath:/jar-bootstrap.rb:221



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to