From 143ee011d46076f75c34a1dda9fab4481516abdc Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Fri, 13 Sep 2013 17:45:51 +0000 Subject: [PATCH] HBASE-9211 "ERROR: undefined method `message' for nil:NilClass" in the shell on error git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1523031 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java | 2 +- hbase-server/src/main/ruby/shell/commands.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 56fb736a736..30bb22257a0 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 @@ -2880,7 +2880,7 @@ public class HBaseAdmin implements Abortable, Closeable { public void cloneSnapshot(final String snapshotName, final TableName tableName) throws IOException, TableExistsException, RestoreSnapshotException, InterruptedException { if (tableExists(tableName)) { - throw new TableExistsException("Table '" + tableName + " already exists"); + throw new TableExistsException(tableName); } internalRestoreSnapshot(snapshotName, tableName); waitUntilTableIsEnabled(tableName); diff --git a/hbase-server/src/main/ruby/shell/commands.rb b/hbase-server/src/main/ruby/shell/commands.rb index dbfa8fce9ad..72f6eb23e73 100644 --- a/hbase-server/src/main/ruby/shell/commands.rb +++ b/hbase-server/src/main/ruby/shell/commands.rb @@ -90,8 +90,8 @@ module Shell rescue org.apache.hadoop.hbase.regionserver.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.TableExistsException => e - raise "Table already exists: #{e.message}!" + rescue org.apache.hadoop.hbase.TableExistsException + raise "Table already exists: #{args.first}!" end end end