diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 7945e1da968..d3f84e1938b 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -2462,7 +2462,7 @@ public class HBaseAdmin implements Abortable, Closeable { public void cloneSnapshot(final String snapshotName, final String tableName) throws IOException, TableExistsException, RestoreSnapshotException, InterruptedException { if (tableExists(tableName)) { - throw new TableExistsException("Table '" + tableName + " already exists"); + throw new TableExistsException(tableName); } internalRestoreSnapshot(snapshotName, tableName); waitUntilTableIsEnabled(Bytes.toBytes(tableName)); diff --git a/hbase-server/src/main/ruby/shell/commands.rb b/hbase-server/src/main/ruby/shell/commands.rb index fba5f1d32d6..6dc35a11ee9 100644 --- a/hbase-server/src/main/ruby/shell/commands.rb +++ b/hbase-server/src/main/ruby/shell/commands.rb @@ -86,8 +86,8 @@ module Shell rescue org.apache.hadoop.hbase.exceptions.NoSuchColumnFamilyException valid_cols = table(args.first).get_all_columns.map { |c| c + '*' } raise "Unknown column family! Valid column names: #{valid_cols.join(", ")}" - rescue org.apache.hadoop.hbase.exceptions.TableExistsException - raise "Table already exists: #{args.first}!" + rescue org.apache.hadoop.hbase.exceptions.TableExistsException => e + raise "Table already exists: #{e.message}!" end end end