Author: jleroux
Date: Thu May 19 05:25:54 2016
New Revision: 1744515
URL: http://svn.apache.org/viewvc?rev=1744515&view=rev
Log:
Improves the visibility of the Start error messages - OFBIZ-6783
Modified:
ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java
ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java
ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupException.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=1744515&r1=1744514&r2=1744515&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
05:25:54 2016
@@ -76,7 +76,8 @@ 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());
+ System.err.println(System.lineSeparator() +
"==============================================================================="
+ System.lineSeparator() + "Error: "
+ + e.getMessage() + System.lineSeparator() +
"==============================================================================="
+ System.lineSeparator());
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=1744515&r1=1744514&r2=1744515&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 05:25:54 2016
@@ -197,7 +197,7 @@ public final class StartupCommandUtil {
Properties optionProperties =
commandLine.getOptionProperties(StartupOption.TEST_LIST.getName());
if(!optionProperties.containsKey("file")
|| !optionProperties.containsKey("mode") ) {
- throw new StartupException("You must pass both file and mode
arguments to --" + StartupOption.TEST_LIST.getName());
+ throw new StartupException("You must pass both file and mode
arguments to --" + StartupOption.TEST_LIST.getName() + ", ie 2 --testlist");
} else if (!optionProperties.get("mode").toString().equals("text")
&& !optionProperties.get("mode").toString().equals("ant"))
{
throw new StartupException("mode only accepts text or ant in
the option --" + StartupOption.TEST_LIST.getName());
Modified:
ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupException.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupException.java?rev=1744515&r1=1744514&r2=1744515&view=diff
==============================================================================
--- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupException.java
(original)
+++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupException.java
Thu May 19 05:25:54 2016
@@ -60,11 +60,13 @@ public class StartupException extends Ex
/** Returns the detail message, including the message from the nested
exception if there is one. */
@Override
public String getMessage() {
+ String msg = super.getMessage();
+ msg = System.lineSeparator() +
"==============================================================================="
+ System.lineSeparator() + msg;
if (getCause() != null) {
- return super.getMessage() + " (" + getCause().getMessage() + ")";
- } else {
- return super.getMessage();
+ msg = msg + " (" + getCause().getMessage() + ")";
+ msg = msg +
"==============================================================================="
+ System.lineSeparator() ;
}
+ return msg;
}
/** Returns the detail message, NOT including the message from the nested
exception. */