Split error message

This commit is contained in:
Paulo Gustavo Veiga 2022-02-12 09:17:52 -08:00
parent f35d145fb8
commit 83cff3f66d

View File

@ -166,9 +166,9 @@ final public class NotificationService {
public void reportJavascriptException(@Nullable Mindmap mindmap, @Nullable User user, @NotNull RestLogItem errorItem, @NotNull HttpServletRequest request) { public void reportJavascriptException(@Nullable Mindmap mindmap, @Nullable User user, @NotNull RestLogItem errorItem, @NotNull HttpServletRequest request) {
final Map<String, String> model = new HashMap<>(); final Map<String, String> summary = new HashMap<>();
model.put("JS-MSG", errorItem.getJsErrorMsg()); summary.put("JS-MSG", errorItem.getJsErrorMsg());
model.put("JS-STACK", errorItem.getJsStack()); summary.put("JS-STACK", errorItem.getJsStack());
String mindmapXML = ""; String mindmapXML = "";
try { try {
@ -176,11 +176,12 @@ final public class NotificationService {
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
// Ignore ... // Ignore ...
} }
model.put("mapId", Integer.toString(mindmap.getId())); summary.put("mapId", Integer.toString(mindmap.getId()));
model.put("mapTitle", mindmap.getTitle()); summary.put("mapTitle", mindmap.getTitle());
logError(model, user, request); logError(summary, user, request);
logger.error("Unexpected editor mindmap => " + mindmapXML); logger.error("Unexpected editor mindmap => " + mindmapXML);
logger.error("Unexpected editor JS Stack => " + errorItem.getJsErrorMsg() + "-" + errorItem.getJsStack());
} }
private void logError(@NotNull Map<String, String> model, @Nullable User user, @NotNull HttpServletRequest request) { private void logError(@NotNull Map<String, String> model, @Nullable User user, @NotNull HttpServletRequest request) {