dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #40771
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20739: CrudControllerAdvice, using exception message instead of class name in response
------------------------------------------------------------
revno: 20739
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-10-16 12:21:28 +0200
message:
CrudControllerAdvice, using exception message instead of class name in response
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/CrudControllerAdvice.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/CrudControllerAdvice.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/CrudControllerAdvice.java 2015-09-08 09:09:53 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/CrudControllerAdvice.java 2015-10-16 10:21:28 +0000
@@ -80,19 +80,19 @@
@ExceptionHandler( { NotAuthenticatedException.class } )
public void notAuthenticatedExceptionHandler( NotAuthenticatedException ex, HttpServletResponse response, HttpServletRequest request )
{
- webMessageService.send( WebMessageUtils.unathorized( ex.getClass().getName() ), response, request );
+ webMessageService.send( WebMessageUtils.unathorized( ex.getMessage() ), response, request );
}
@ExceptionHandler( { NotFoundException.class } )
public void notFoundExceptionHandler( NotFoundException ex, HttpServletResponse response, HttpServletRequest request )
{
- webMessageService.send( WebMessageUtils.notFound( ex.getClass().getName() ), response, request );
+ webMessageService.send( WebMessageUtils.notFound( ex.getMessage() ), response, request );
}
@ExceptionHandler( ConstraintViolationException.class )
public void constraintViolationExceptionHandler( ConstraintViolationException ex, HttpServletResponse response, HttpServletRequest request )
{
- webMessageService.send( WebMessageUtils.unprocessableEntity( ex.getClass().getName() ), response, request );
+ webMessageService.send( WebMessageUtils.unprocessableEntity( ex.getMessage() ), response, request );
}
@ExceptionHandler( { IllegalQueryException.class, IllegalArgumentException.class, DeleteNotAllowedException.class } )
@@ -104,13 +104,13 @@
@ExceptionHandler( MaintenanceModeException.class )
public void maintenanceModeExceptionHandler( MaintenanceModeException ex, HttpServletResponse response, HttpServletRequest request )
{
- webMessageService.send( WebMessageUtils.serviceUnavailable( ex.getClass().getName() ), response, request );
+ webMessageService.send( WebMessageUtils.serviceUnavailable( ex.getMessage() ), response, request );
}
@ExceptionHandler( DataApprovalException.class )
public void dataApprovalExceptionHandler( DataApprovalException ex, HttpServletResponse response, HttpServletRequest request )
{
- webMessageService.send( WebMessageUtils.conflict( ex.getClass().getName() ), response, request ); //TODO fix message
+ webMessageService.send( WebMessageUtils.conflict( ex.getMessage() ), response, request ); //TODO fix message
}
@ExceptionHandler( AccessDeniedException.class )