
net.winterly.rxjersey.client.RxClientExceptionMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-client Show documentation
Show all versions of core-client Show documentation
RxJava extension for Jersey and Dropwizard
The newest version!
package net.winterly.rxjersey.client;
import javax.ws.rs.ClientErrorException;
import javax.ws.rs.client.ResponseProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
/**
* Exception mapper to bypass response from client as server response
* For example if client returns {@code 404 Not Found} error then server response will be same including content
*/
public class RxClientExceptionMapper implements ExceptionMapper {
@Override
public Response toResponse(ResponseProcessingException exception) {
ClientErrorException clientErrorException = (ClientErrorException) exception.getCause();
return clientErrorException.getResponse();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy