Skip to content

Commit b1cf4ef

Browse files
committed
Improved: Don't need to show files names in UI messages (OFBIZ-12884)
We don't need to show files names in UI messages. it's already in log. It does not help users and rather confuse them. Conflict handled by hand
1 parent 707434c commit b1cf4ef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,13 @@ public String exec(MethodContext methodContext) throws MiniLangException {
457457
finished = runSubOps(methodOperations, methodContext);
458458
} catch (Throwable t) {
459459
// make SURE nothing gets thrown through
460-
String errMsg = UtilProperties.getMessage(SimpleMethod.err_resource, "simpleMethod.error_running", locale) + ": " + t.getMessage();
460+
String errorMessage = t.getMessage();
461+
if (errorMessage.contains("File = file") && errorMessage.contains("Events.xml")) {
462+
String noFile = errorMessage.substring(errorMessage.indexOf("File = file"),
463+
errorMessage.indexOf("Events.xml") + "Events.xml".length());
464+
errorMessage = errorMessage.replace(noFile, "");
465+
}
466+
String errMsg = UtilProperties.getMessage(SimpleMethod.err_resource, "simpleMethod.error_running", locale) + ": " + errorMessage;
461467
if (methodContext.isTraceOn()) {
462468
outputTraceMessage(methodContext, "An exception was thrown while running sub-elements, error message was:", errMsg);
463469
}

0 commit comments

Comments
 (0)