From eab243942f4912cdcbebab8a67fa67e89e69dae2 Mon Sep 17 00:00:00 2001 From: Sakthi Date: Wed, 26 Dec 2018 17:01:22 -0800 Subject: [PATCH] HBASE-21362: Disable printing of stack-trace in shell when quotas are violated Signed-off-by: Josh Elser --- hbase-shell/src/main/ruby/shell/commands.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hbase-shell/src/main/ruby/shell/commands.rb b/hbase-shell/src/main/ruby/shell/commands.rb index f90b5d36c30..00ee8ebc5c9 100644 --- a/hbase-shell/src/main/ruby/shell/commands.rb +++ b/hbase-shell/src/main/ruby/shell/commands.rb @@ -167,6 +167,16 @@ module Shell strs = str.split("\n") raise (strs[0]).to_s unless strs.empty? end + if cause.is_a?(org.apache.hadoop.hbase.quotas.SpaceLimitingException) + strs = cause.message.split("\n") + raise(strs[0]).to_s unless strs.empty? + end + if cause.is_a?(org.apache.hadoop.hbase.client.RetriesExhaustedException) + str = cause.cause.to_s + regex = /.*RpcThrottlingException: (?[^\n]+).*/ + error = regex.match(str) + raise error[:message].capitalize unless error.nil? + end # Throw the other exception which hasn't been handled above raise cause