|
|
@@ -43,18 +43,15 @@ public class ExceptionHandlerAdvice {
|
|
|
map.put("success", false);
|
|
|
if (e instanceof ReportException) {
|
|
|
map.put("message", e.getMessage());
|
|
|
- } else {
|
|
|
- map.put("message", e.getClass().getSimpleName() + ": " + e.getMessage());
|
|
|
- }
|
|
|
- HttpHeaders headers = new HttpHeaders();
|
|
|
- headers.add("Content-Type", "application/json; charset=utf-8");
|
|
|
- if (e instanceof ReportException) {
|
|
|
ReportException exception = (ReportException) e;
|
|
|
if (!StringUtils.isEmpty(exception.getDetailedMessage())) {
|
|
|
map.put("detailedMessage", exception.getDetailedMessage());
|
|
|
}
|
|
|
- return new ResponseEntity<ModelMap>(map, headers, HttpStatus.BAD_REQUEST);
|
|
|
+ } else {
|
|
|
+ map.put("message", e.getClass().getSimpleName() + ": " + e.getMessage());
|
|
|
}
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ headers.add("Content-Type", "application/json; charset=utf-8");
|
|
|
return new ResponseEntity<ModelMap>(map, headers, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
}
|
|
|
|