mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-26 15:54:55 +01:00
On editor error, send notification emails.
This commit is contained in:
parent
34bd8edd42
commit
5a765b2f2c
@ -25,6 +25,7 @@ import com.wisemapping.rest.model.RestLogItem;
|
|||||||
import com.wisemapping.security.Utils;
|
import com.wisemapping.security.Utils;
|
||||||
import com.wisemapping.service.MindmapService;
|
import com.wisemapping.service.MindmapService;
|
||||||
import com.wisemapping.service.UserService;
|
import com.wisemapping.service.UserService;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@ -44,6 +45,9 @@ public class AccountController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private NotificationService notificationService;
|
private NotificationService notificationService;
|
||||||
|
|
||||||
|
final Logger logger = Logger.getLogger("com.wisemapping");
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.PUT, value = "account/password", consumes = {"text/plain"})
|
@RequestMapping(method = RequestMethod.PUT, value = "account/password", consumes = {"text/plain"})
|
||||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||||
public void changePassword(@RequestBody String password) {
|
public void changePassword(@RequestBody String password) {
|
||||||
@ -98,6 +102,7 @@ public class AccountController extends BaseController {
|
|||||||
public void changePassword(@RequestBody RestLogItem item) {
|
public void changePassword(@RequestBody RestLogItem item) {
|
||||||
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.reportMindmapEditorError(mindmap, user, item.getUserAgent(), item.getJsErrorMsg() + "\n" + item.getJsStack());
|
notificationService.reportMindmapEditorError(mindmap, user, item.getUserAgent(), item.getJsErrorMsg() + "\n" + item.getJsStack());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user