HBASE-21362: Disable printing of stack-trace in shell when quotas are violated

Signed-off-by: Josh Elser <elserj@apache.org>
This commit is contained in:
Sakthi 2018-12-26 17:01:22 -08:00 committed by Josh Elser
parent 97219f1ace
commit eab243942f
1 changed files with 10 additions and 0 deletions

View File

@ -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: (?<message>[^\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