You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/08/10 17:24:31 UTC

[GitHub] [hbase] bitoffdev commented on a change in pull request #2232: HBASE-24806 Small Updates to Functionality of Shell IRB Workspace

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



##########
File path: hbase-shell/src/main/ruby/shell.rb
##########
@@ -335,12 +348,9 @@ def eval_io(io)
         # Include the 'ERROR' string to try to make transition easier for scripts that
         # may have already been relying on grepping output.
         puts "ERROR #{e.class}: #{message}"
-        if $fullBacktrace
-          # re-raising the will include a backtrace and exit.
-          raise e
-        else
-          exit 1
-        end
+        raise e unless hide_traceback
+
+        exit 1

Review comment:
       Ruby allows one-line conditionals such as `<statement> if <condition>`, which is equivalent to `if <condition>; <statement>; end`. It's a fun feature of Ruby :smile:.
   
   So, this logic will raise SystemExit (via `exit 1`) if we want to hide the traceback.




----------------------------------------------------------------
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:
users@infra.apache.org