This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new b829eb2  Log error (if any) in Shell.runCommand
b829eb2 is described below

commit b829eb2e11d211cefb283c0919f2b893d30d2f35
Author: Charan Reddy Guttapalem <[email protected]>
AuthorDate: Sun Feb 24 21:36:16 2019 -0800

    Log error (if any) in Shell.runCommand
    
    
    
    Descriptions of the changes in this PR:
    - Log error (if any) in Shell.runCommand even in the case of successful 
execution
    
    Reviewers: Enrico Olivelli <[email protected]>, Sijie Guo 
<[email protected]>
    
    This closes #1956 from reddycharan/printshellerror
---
 .../src/main/java/org/apache/bookkeeper/util/Shell.java              | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/Shell.java 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/Shell.java
index 60c7648..8067a60 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/Shell.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/Shell.java
@@ -176,6 +176,11 @@ public abstract class Shell {
             //taken care in finally block
             if (exitCode != 0) {
                 throw new ExitCodeException(exitCode, errMsg.toString());
+            } else {
+                String errMsgStr = errMsg.toString();
+                if (!errMsgStr.isEmpty()) {
+                    LOG.error(errMsgStr);
+                }
             }
         } catch (InterruptedException ie) {
             Thread.currentThread().interrupt();

Reply via email to