import javax.annotation.*;
import javax.ws.rs.core.*;
import javax.ws.rs.ext.*;

@Provider
@Priority(4999)
public class CustomExceptionMapper implements ExceptionMapper<Throwable>
{
	@Override
	public Response toResponse(final Throwable anException)
	{
		...
	}
}