mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-21 21:57:56 +01:00
Improve JS error loggin
This commit is contained in:
parent
609fdd7144
commit
f35d145fb8
@ -22,6 +22,7 @@ import com.wisemapping.filter.SupportedUserAgent;
|
|||||||
import com.wisemapping.model.Collaboration;
|
import com.wisemapping.model.Collaboration;
|
||||||
import com.wisemapping.model.Mindmap;
|
import com.wisemapping.model.Mindmap;
|
||||||
import com.wisemapping.model.User;
|
import com.wisemapping.model.User;
|
||||||
|
import com.wisemapping.rest.model.RestLogItem;
|
||||||
import com.wisemapping.util.VelocityEngineUtils;
|
import com.wisemapping.util.VelocityEngineUtils;
|
||||||
import com.wisemapping.util.VelocityEngineWrapper;
|
import com.wisemapping.util.VelocityEngineWrapper;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
@ -163,10 +164,11 @@ final public class NotificationService {
|
|||||||
this.velocityEngineWrapper = engine;
|
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<String, String> model = new HashMap<>();
|
final Map<String, String> model = new HashMap<>();
|
||||||
model.put("errorMsg", jsErrorMsg);
|
model.put("JS-MSG", errorItem.getJsErrorMsg());
|
||||||
|
model.put("JS-STACK", errorItem.getJsStack());
|
||||||
|
|
||||||
String mindmapXML = "";
|
String mindmapXML = "";
|
||||||
try {
|
try {
|
||||||
|
@ -133,8 +133,8 @@ public class AccountController extends BaseController {
|
|||||||
public void logError(@RequestBody RestLogItem item, @NotNull HttpServletRequest request) {
|
public void logError(@RequestBody RestLogItem item, @NotNull HttpServletRequest request) {
|
||||||
final Mindmap mindmap = mindmapService.findMindmapById(item.getMapId());
|
final Mindmap mindmap = mindmapService.findMindmapById(item.getMapId());
|
||||||
final User user = Utils.getUser();
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user