You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ta...@apache.org on 2016/05/19 07:54:16 UTC

svn commit: r1744525 - in /ofbiz/trunk/framework/start/src/org/ofbiz/base/start: Start.java StartupCommandUtil.java

Author: taher
Date: Thu May 19 07:54:16 2016
New Revision: 1744525

URL: http://svn.apache.org/viewvc?rev=1744525&view=rev
Log:
provide pretty printing for error messages for startup OFBIZ-6783

Box the error messages with "=======" strings to highlight
the error the to user when calling java -jar ofbiz.jar --somewrongcommand

Modified:
    ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java
    ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java

Modified: ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java?rev=1744525&r1=1744524&r2=1744525&view=diff
==============================================================================
--- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java (original)
+++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java Thu May 19 07:54:16 2016
@@ -76,7 +76,7 @@ public final class Start {
             ofbizCommands = StartupCommandUtil.parseOfbizCommands(args);
         } catch (StartupException e) {
             // incorrect arguments passed to the command line
-            System.err.println("Error: " + e.getMessage() + System.lineSeparator());
+            StartupCommandUtil.printAndHighlightMessage(e.getMessage());
             StartupCommandUtil.printOfbizStartupHelp(System.err);
             System.exit(1);
         }

Modified: ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java?rev=1744525&r1=1744524&r2=1744525&view=diff
==============================================================================
--- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java (original)
+++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java Thu May 19 07:54:16 2016
@@ -176,6 +176,16 @@ public final class StartupCommandUtil {
                 true);
     }
 
+    static final void printAndHighlightMessage(String message) {
+        System.err.println(
+                "==============================================================================="
+                + System.lineSeparator()
+                + message
+                + System.lineSeparator()
+                + "==============================================================================="
+                );
+    }
+
     private static final List<StartupCommand> mapCommonsCliOptionsToStartupCommands(final CommandLine commandLine) {
         List<Option> optionList = Arrays.asList(commandLine.getOptions()); 
         return optionList.stream()