package org.jboss.resteasy.test.rx.resource;

import java.io.IOException;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;

@FilterException
@Provider
public class ExceptionThrowingFilter implements ContainerResponseFilter
{

   @Override
   public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
         throws IOException
   {
      throw new WebApplicationException(Response.ok("exception", MediaType.TEXT_PLAIN).build());
   }

}
