From 609fdd71443414ba761551a380f7714db07df290 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 08:35:29 -0800 Subject: [PATCH] Split error message on browser error. --- .../java/com/wisemapping/mail/NotificationService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java index 30a1932d..124e17f5 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java @@ -167,8 +167,10 @@ final public class NotificationService { final Map model = new HashMap<>(); model.put("errorMsg", jsErrorMsg); + + String mindmapXML = ""; try { - model.put("mapXML", StringEscapeUtils.escapeXml(mindmap == null ? "map not found" : mindmap.getXmlStr())); + mindmapXML = StringEscapeUtils.escapeXml(mindmap == null ? "map not found" : mindmap.getXmlStr()); } catch (UnsupportedEncodingException e) { // Ignore ... } @@ -176,6 +178,7 @@ final public class NotificationService { model.put("mapTitle", mindmap.getTitle()); logError(model, user, request); + logger.error("Unexpected editor mindmap => " + mindmapXML); } private void logError(@NotNull Map model, @Nullable User user, @NotNull HttpServletRequest request) { @@ -193,7 +196,7 @@ final public class NotificationService { .map(key -> key + "=" + model.get(key)) .collect(Collectors.joining(", ", "{", "}")); - logger.error("Unexpected editor error => " + errorAsString); + logger.error("Unexpected editor info => " + errorAsString); } public void reportJavaException(@NotNull Throwable exception, @Nullable User user, @NotNull HttpServletRequest request) {