Package org.apache.rave.rest.model

Examples of org.apache.rave.rest.model.ErrorWrapperResponse


public class NotFoundExceptionMapper implements ExceptionMapper<ResourceNotFoundException> {

    @Override
    public Response toResponse(ResourceNotFoundException e) {
        String id = e.getMessage();
        return Response.status(Response.Status.NOT_FOUND).entity(new ErrorWrapperResponse(
                "The requested resource could not be found. "+e.getMessage(),
                "The requested resource could not be found."
        )).build();
    }
View Full Code Here


@Produces(MediaType.APPLICATION_JSON)
public class BadRequestExceptionMapper implements ExceptionMapper<BadRequestException> {

    @Override
    public Response toResponse(BadRequestException e) {
        return Response.status(Response.Status.BAD_REQUEST).entity(new ErrorWrapperResponse(
                e.getMessage(),
                "The server received a bad request."
        )).build();
    }
View Full Code Here

TOP

Related Classes of org.apache.rave.rest.model.ErrorWrapperResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.