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 124e17f5..33f4596b 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java @@ -22,6 +22,7 @@ import com.wisemapping.filter.SupportedUserAgent; import com.wisemapping.model.Collaboration; import com.wisemapping.model.Mindmap; import com.wisemapping.model.User; +import com.wisemapping.rest.model.RestLogItem; import com.wisemapping.util.VelocityEngineUtils; import com.wisemapping.util.VelocityEngineWrapper; import org.apache.commons.io.IOUtils; @@ -163,10 +164,11 @@ final public class NotificationService { this.velocityEngineWrapper = engine; } - public void reportJavascriptException(@Nullable Mindmap mindmap, @Nullable User user, @Nullable String jsErrorMsg, @NotNull HttpServletRequest request) { + public void reportJavascriptException(@Nullable Mindmap mindmap, @Nullable User user, @NotNull RestLogItem errorItem, @NotNull HttpServletRequest request) { final Map model = new HashMap<>(); - model.put("errorMsg", jsErrorMsg); + model.put("JS-MSG", errorItem.getJsErrorMsg()); + model.put("JS-STACK", errorItem.getJsStack()); String mindmapXML = ""; try { diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java index e396ac18..630f274c 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java @@ -133,8 +133,8 @@ public class AccountController extends BaseController { public void logError(@RequestBody RestLogItem item, @NotNull HttpServletRequest request) { final Mindmap mindmap = mindmapService.findMindmapById(item.getMapId()); final User user = Utils.getUser(); - logger.error("Unexpected editor error - " + item.getJsErrorMsg()); - notificationService.reportJavascriptException(mindmap, user, item.getJsErrorMsg() + "\n" + item.getJsStack(), request); + + notificationService.reportJavascriptException(mindmap, user, item, request); } }