mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 14:17:57 +01:00
Improve error reporting.
This commit is contained in:
parent
751692837c
commit
df98282620
@ -65,7 +65,7 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
onFailure:function (xhr) {
|
||||
|
||||
var responseText = xhr.responseText;
|
||||
var userMsg = {severity:"ERROR", message:$msg('SAVE_COULD_NOT_BE_COMPLETED')};
|
||||
var userMsg = {severity:"SEVERE", message:$msg('SAVE_COULD_NOT_BE_COMPLETED')};
|
||||
|
||||
var contentType = this.getHeader("Content-Type");
|
||||
if (contentType != null && contentType.indexOf("application/json") != -1) {
|
||||
@ -80,7 +80,7 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
|
||||
} else {
|
||||
if (this.status == 405) {
|
||||
userMsg = {severity:"ERROR", message:$msg('SESSION_EXPIRED')};
|
||||
userMsg = {severity:"SEVERE", message:$msg('SESSION_EXPIRED')};
|
||||
}
|
||||
}
|
||||
events.onError(userMsg);
|
||||
|
@ -63,20 +63,20 @@ public class BaseController {
|
||||
@ExceptionHandler(Exception.class)
|
||||
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
@ResponseBody
|
||||
public String handleServerErrors(@NotNull Exception ex, @NotNull HttpServletRequest request) {
|
||||
public RestErrors handleServerErrors(@NotNull Exception ex, @NotNull HttpServletRequest request) {
|
||||
final User user = Utils.getUser();
|
||||
notificationService.reportJavaException(ex, user, request);
|
||||
return ex.getMessage();
|
||||
return new RestErrors(ex.getMessage(),Severity.SEVERE);
|
||||
}
|
||||
|
||||
|
||||
@ExceptionHandler(ImportUnexpectedException.class)
|
||||
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
@ResponseBody
|
||||
public String handleImportErrors(@NotNull ImportUnexpectedException ex, @NotNull HttpServletRequest request) {
|
||||
public RestErrors handleImportErrors(@NotNull ImportUnexpectedException ex, @NotNull HttpServletRequest request) {
|
||||
final User user = Utils.getUser();
|
||||
notificationService.reportJavaException(ex, user, new String(ex.getFreemindXml()), request);
|
||||
return ex.getMessage();
|
||||
return new RestErrors(ex.getMessage(),Severity.SEVERE);
|
||||
}
|
||||
|
||||
@ExceptionHandler(ValidationException.class)
|
||||
@ -87,8 +87,8 @@ public class BaseController {
|
||||
|
||||
@ExceptionHandler(JsonHttpMessageNotReadableException.class)
|
||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||
public String handleJSONErrors(@NotNull JsonHttpMessageNotReadableException ex) {
|
||||
return "Request could not be saved. Message is not valid";
|
||||
public RestErrors handleJSONErrors(@NotNull JsonHttpMessageNotReadableException ex) {
|
||||
return new RestErrors("Communication error",Severity.SEVERE);
|
||||
}
|
||||
|
||||
@ExceptionHandler(java.lang.reflect.UndeclaredThrowableException.class)
|
||||
|
Loading…
Reference in New Issue
Block a user