Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8162A2009F9 for ; Mon, 23 May 2016 21:22:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 80064160A0E; Mon, 23 May 2016 19:22:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C8191160A05 for ; Mon, 23 May 2016 21:22:12 +0200 (CEST) Received: (qmail 86153 invoked by uid 500); 23 May 2016 19:22:12 -0000 Mailing-List: contact commits-help@falcon.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@falcon.apache.org Delivered-To: mailing list commits@falcon.apache.org Received: (qmail 86144 invoked by uid 99); 23 May 2016 19:22:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 May 2016 19:22:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B7A01DFB38; Mon, 23 May 2016 19:22:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: balu@apache.org To: commits@falcon.apache.org Message-Id: <6961e533c94344d385613f2229622539@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: falcon git commit: FALCON-1969 Provide server-side error details on CLI, if any Date: Mon, 23 May 2016 19:22:11 +0000 (UTC) archived-at: Mon, 23 May 2016 19:22:13 -0000 Repository: falcon Updated Branches: refs/heads/master d59ff0d1b -> 004e612d4 FALCON-1969 Provide server-side error details on CLI, if any Here is a sample CLI output for comparison. Before: _[ambari-qasandbox falcon-0.10-SNAPSHOT]$ bin/falcon extension -submit -extensionName hdfs-mirroring -file /tmp/falcon-xml/hdfs-mirror-para.txt Hadoop is installed, adding hadoop classpath to falcon classpath SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/2.4.0.0-169/falcon-0.10-SNAPSHOT/client/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.4.0.0-169/falcon-0.10-SNAPSHOT/client/lib/falcon-cli-0.10-SNAPSHOT.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.4.0.0-169/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] ERROR: Internal Server Error;_ After: _[ambari-qasandbox falcon-0.10-SNAPSHOT]$ bin/falcon extension -submit -extensionName hdfs-mirroring -file /tmp/falcon-xml/hdfs-mirror-para.txt Hadoop is installed, adding hadoop classpath to falcon classpath SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/2.4.0.0-169/falcon-0.10-SNAPSHOT/client/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.4.0.0-169/falcon-0.10-SNAPSHOT/client/lib/falcon-cli-0.10-SNAPSHOT.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.4.0.0-169/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] ERROR: Internal Server Error;**Missing extension property: jobName**_ Author: yzheng-hortonworks Reviewers: "Balu Vellanki " Closes #148 from yzheng-hortonworks/FALCON-1969 and squashes the following commits: 2956e89 [yzheng-hortonworks] show error details on CLI 7a76b4a [yzheng-hortonworks] FALCON-1969 Provide server-side error details on CLI, if any Project: http://git-wip-us.apache.org/repos/asf/falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/004e612d Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/004e612d Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/004e612d Branch: refs/heads/master Commit: 004e612d48076b0e2022aeff5d01bb4bed4c8094 Parents: d59ff0d Author: yzheng-hortonworks Authored: Mon May 23 12:22:00 2016 -0700 Committer: bvellanki Committed: Mon May 23 12:22:00 2016 -0700 ---------------------------------------------------------------------- .../falcon/client/FalconCLIException.java | 26 +++++++++----------- 1 file changed, 12 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/falcon/blob/004e612d/client/src/main/java/org/apache/falcon/client/FalconCLIException.java ---------------------------------------------------------------------- diff --git a/client/src/main/java/org/apache/falcon/client/FalconCLIException.java b/client/src/main/java/org/apache/falcon/client/FalconCLIException.java index 29efbae..bd36243 100644 --- a/client/src/main/java/org/apache/falcon/client/FalconCLIException.java +++ b/client/src/main/java/org/apache/falcon/client/FalconCLIException.java @@ -47,21 +47,19 @@ public class FalconCLIException extends Exception { ClientResponse.Status status = clientResponse.getClientResponseStatus(); String statusValue = status.toString(); String message = ""; - if (status == ClientResponse.Status.BAD_REQUEST) { - clientResponse.bufferEntity(); - InputStream in = clientResponse.getEntityInputStream(); + clientResponse.bufferEntity(); + InputStream in = clientResponse.getEntityInputStream(); + try { + in.mark(MB); + message = clientResponse.getEntity(APIResult.class).getMessage(); + } catch (Throwable th) { + byte[] data = new byte[MB]; try { - in.mark(MB); - message = clientResponse.getEntity(APIResult.class).getMessage(); - } catch (Throwable th) { - byte[] data = new byte[MB]; - try { - in.reset(); - int len = in.read(data); - message = new String(data, 0, len); - } catch (IOException e) { - message = e.getMessage(); - } + in.reset(); + int len = in.read(data); + message = new String(data, 0, len); + } catch (IOException e) { + message = e.getMessage(); } } return new FalconCLIException(statusValue + ";" + message);