All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gate.rest.exception.BadRequestExceptionMapper Maven / Gradle / Ivy

There is a newer version: 12.3.1
Show newest version
package gate.rest.exception;

import gate.error.BadRequestException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

@Provider
public class BadRequestExceptionMapper implements ExceptionMapper
{

	@Override
	public Response toResponse(BadRequestException ex)
	{
		return Response.status(Response.Status.BAD_REQUEST)
			.entity(ex.getMessage())
			.type(MediaType.TEXT_PLAIN)
			.build();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy