HBASE-9210: hbase shell -d doesn't print out exception stack trace
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1516293 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a0b240db54
commit
ed864807e3
|
@ -114,6 +114,7 @@ require 'shell/formatter'
|
|||
|
||||
# Setup console
|
||||
@shell = Shell::Shell.new(@hbase, @formatter)
|
||||
@shell.debug = @shell_debug
|
||||
|
||||
# Add commands to this namespace
|
||||
@shell.export_commands(self)
|
||||
|
|
|
@ -365,7 +365,7 @@ def loadRegions(options, hostname)
|
|||
begin
|
||||
isSuccessfulScan(admin, r)
|
||||
exists = true
|
||||
rescue org.apache.hadoop.hbase.exceptions.NotServingRegionException => e
|
||||
rescue org.apache.hadoop.hbase.NotServingRegionException => e
|
||||
$LOG.info("Failed scan of " + e.message)
|
||||
end
|
||||
count = count + 1
|
||||
|
|
|
@ -47,7 +47,7 @@ require 'java'
|
|||
|
||||
import org.apache.hadoop.hbase.HBaseConfiguration
|
||||
import org.apache.hadoop.hbase.HConstants
|
||||
import org.apache.hadoop.hbase.exceptions.MasterNotRunningException
|
||||
import org.apache.hadoop.hbase.MasterNotRunningException
|
||||
import org.apache.hadoop.hbase.client.HBaseAdmin
|
||||
import org.apache.hadoop.hbase.client.HTable
|
||||
import org.apache.hadoop.hbase.client.Scan
|
||||
|
|
|
@ -33,9 +33,13 @@ module Shell
|
|||
#(everything is a message, so this is just the formal semantics to support that idiom)
|
||||
translate_hbase_exceptions(*args) { send(cmd,*args) }
|
||||
rescue => e
|
||||
rootCause = e
|
||||
while rootCause != nil && rootCause.respond_to?(:cause) && rootCause.cause != nil
|
||||
rootCause = rootCause.cause
|
||||
end
|
||||
puts
|
||||
puts "ERROR: #{e}"
|
||||
puts "Backtrace: #{e.backtrace.join("\n ")}" if debug
|
||||
puts "ERROR: #{rootCause}"
|
||||
puts "Backtrace: #{rootCause.backtrace.join("\n ")}" if debug
|
||||
puts
|
||||
puts "Here is some help for this command:"
|
||||
puts help
|
||||
|
|
Loading…
Reference in New Issue