From f5b4cc9ea7ca2da904e96150c82fc3dacdb02aae Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Fri, 29 Mar 2013 22:44:13 -0300 Subject: [PATCH] Add debung info for exceptions.... --- .../com/wisemapping/rest/BaseController.java | 22 ++++++++++--------- .../wisemapping/webmvc/MindmapController.java | 1 - 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java b/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java index d2a7fc26..8254abf2 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java @@ -60,16 +60,6 @@ public class BaseController { return new RestErrors(ex.getMessage(),Severity.WARNING); } - @ExceptionHandler(Exception.class) - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - @ResponseBody - public RestErrors handleServerErrors(@NotNull Exception ex, @NotNull HttpServletRequest request) { - final User user = Utils.getUser(); - notificationService.reportJavaException(ex, user, request); - return new RestErrors(ex.getMessage(),Severity.SEVERE); - } - - @ExceptionHandler(ImportUnexpectedException.class) @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ResponseBody @@ -110,4 +100,16 @@ public class BaseController { final Locale locale = LocaleContextHolder.getLocale(); return new RestErrors(ex.getMessage(messageSource, locale),ex.getSeverity(),ex.getTechInfo()); } + + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ResponseBody + public RestErrors handleServerErrors(@NotNull Exception ex, @NotNull HttpServletRequest request) { + final User user = Utils.getUser(false); + notificationService.reportJavaException(ex, user, request); + ex.printStackTrace(); + return new RestErrors(ex.getMessage(),Severity.SEVERE); + } + + } diff --git a/wise-webapp/src/main/java/com/wisemapping/webmvc/MindmapController.java b/wise-webapp/src/main/java/com/wisemapping/webmvc/MindmapController.java index 768b8c14..f413dffe 100644 --- a/wise-webapp/src/main/java/com/wisemapping/webmvc/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/webmvc/MindmapController.java @@ -19,7 +19,6 @@ package com.wisemapping.webmvc; -import com.wisemapping.exceptions.AccessDeniedSecurityException; import com.wisemapping.exceptions.MapCouldNotFoundException; import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.model.CollaborationRole;