saintstack commented on a change in pull request #2232:
URL: https://github.com/apache/hbase/pull/2232#discussion_r471916702



##########
File path: hbase-shell/src/main/ruby/shell.rb
##########
@@ -320,10 +323,20 @@ def eval_io(io)
       scanner = RubyLex.new
       scanner.set_input(io)
 
+      scanner.each_top_level_statement do |statement, linenum|
+        puts(workspace.evaluate(nil, statement, filename, linenum))
+      end
+      nil
+    end
+
+    ##
+    # Runs a block and logs exception from both Ruby and Java, optionally 
discarding the traceback
+    #
+    # @param [Boolean] hide_traceback if true, Exceptions will be converted to
+    #   a SystemExit so that the traceback is not printed
+    def self.exception_handler(hide_traceback)
       begin
-        scanner.each_top_level_statement do |statement, linenum|
-          puts(workspace.evaluate(nil, statement, 'stdin', linenum))
-        end
+        yield

Review comment:
       We need this begin/rescue w/ a yield in the middle of it?

##########
File path: hbase-shell/src/main/ruby/shell.rb
##########
@@ -320,10 +323,20 @@ def eval_io(io)
       scanner = RubyLex.new
       scanner.set_input(io)
 
+      scanner.each_top_level_statement do |statement, linenum|
+        puts(workspace.evaluate(nil, statement, filename, linenum))
+      end
+      nil
+    end
+
+    ##
+    # Runs a block and logs exception from both Ruby and Java, optionally 
discarding the traceback
+    #
+    # @param [Boolean] hide_traceback if true, Exceptions will be converted to
+    #   a SystemExit so that the traceback is not printed
+    def self.exception_handler(hide_traceback)
       begin
-        scanner.each_top_level_statement do |statement, linenum|
-          puts(workspace.evaluate(nil, statement, 'stdin', linenum))
-        end
+        yield

Review comment:
       Whats going on here? We are skipping output of the exception stack trace?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to