HBASE-21361: Disable printing of stack-trace in shell when quotas are not enabled

Signed-off-by: Josh Elser <elserj@apache.org>
This commit is contained in:
Sakthi 2018-12-21 10:47:16 -08:00 committed by Josh Elser
parent a735a47532
commit 5aaa73434e
1 changed files with 6 additions and 0 deletions

View File

@ -179,6 +179,12 @@ module Shell
error = regex.match(str)
raise error[:message].capitalize unless error.nil?
end
if cause.is_a?(org.apache.hadoop.hbase.DoNotRetryIOException)
regex = /.*UnsupportedOperationException: quota support disabled.*/
error = regex.match(cause.message)
error_msg = 'Quota Support disabled. Please enable in configuration.'
raise error_msg unless error.nil?
end
# Throw the other exception which hasn't been handled above
raise cause