com.restfully.shop.services
Class EntityNotFoundExceptionMapper
java.lang.Object
com.restfully.shop.services.EntityNotFoundExceptionMapper
- All Implemented Interfaces:
- ExceptionMapper<javax.persistence.EntityNotFoundException>
@Provider
public class EntityNotFoundExceptionMapper
- extends Object
- implements ExceptionMapper<javax.persistence.EntityNotFoundException>
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EntityNotFoundExceptionMapper
public EntityNotFoundExceptionMapper()
toResponse
public Response toResponse(javax.persistence.EntityNotFoundException exception)
- Description copied from interface:
ExceptionMapper
- Map an exception to a
Response
. Returning
null
results in a Response.Status.NO_CONTENT
response. Throwing a runtime exception results in a
Response.Status.INTERNAL_SERVER_ERROR
response
- Specified by:
toResponse
in interface ExceptionMapper<javax.persistence.EntityNotFoundException>
- Parameters:
exception
- the exception to map to a response
- Returns:
- a response mapped from the supplied exception
Copyright © 2011. All Rights Reserved.