Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96E9011396 for ; Mon, 14 Apr 2014 18:59:55 +0000 (UTC) Received: (qmail 70632 invoked by uid 500); 14 Apr 2014 18:59:54 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 70571 invoked by uid 500); 14 Apr 2014 18:59:54 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 70564 invoked by uid 99); 14 Apr 2014 18:59:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Apr 2014 18:59:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Apr 2014 18:59:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 399CE23888E2; Mon, 14 Apr 2014 18:59:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1587282 - /hbase/trunk/hbase-shell/src/main/ruby/shell/commands.rb Date: Mon, 14 Apr 2014 18:59:33 -0000 To: commits@hbase.apache.org From: rajeshbabu@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140414185933.399CE23888E2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rajeshbabu Date: Mon Apr 14 18:59:32 2014 New Revision: 1587282 URL: http://svn.apache.org/r1587282 Log: HBASE-10533 commands.rb is giving wrong error messages on exceptions(rajeshbabu) Modified: hbase/trunk/hbase-shell/src/main/ruby/shell/commands.rb Modified: hbase/trunk/hbase-shell/src/main/ruby/shell/commands.rb URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-shell/src/main/ruby/shell/commands.rb?rev=1587282&r1=1587281&r2=1587282&view=diff ============================================================================== --- hbase/trunk/hbase-shell/src/main/ruby/shell/commands.rb (original) +++ hbase/trunk/hbase-shell/src/main/ruby/shell/commands.rb Mon Apr 14 18:59:32 2014 @@ -95,14 +95,28 @@ module Shell # Get the special java exception which will be handled cause = e.cause if cause.kind_of?(org.apache.hadoop.hbase.TableNotFoundException) then - raise "Unknown table #{args.first}!" + str = java.lang.String.new("#{cause}") + raise "Unknown table #{str}!" end - if cause.kind_of?(org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException) then - valid_cols = table(args.first).get_all_columns.map { |c| c + '*' } - raise "Unknown column family! Valid column names: #{valid_cols.join(", ")}" + if cause.kind_of?(org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException) then + exceptions = cause.getCauses + exceptions.each do |exception| + if exception.kind_of?(org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException) then + valid_cols = table(args.first).get_all_columns.map { |c| c + '*' } + raise "Unknown column family! Valid column names: #{valid_cols.join(", ")}" + end + end end if cause.kind_of?(org.apache.hadoop.hbase.TableExistsException) then - raise "Table already exists: #{args.first}!" + str = java.lang.String.new("#{cause}") + strs = str.split("\n") + if strs.size > 0 then + s = strs[0].split(' '); + if(s.size > 1) + raise "Table already exists: #{s[1]}!" + end + raise "Table already exists: #{strs[0]}!" + end end # To be safe, here only AccessDeniedException is considered. In future # we might support more in more generic approach when possible.