org.jboss.resteasy.client.exception.ResteasyServerErrorException Maven / Gradle / Ivy
package org.jboss.resteasy.client.exception;
import static org.jboss.resteasy.client.exception.WebApplicationExceptionWrapper.sanitize;
import javax.ws.rs.ServerErrorException;
import javax.ws.rs.core.Response;
/**
* Wraps a {@link ServerErrorException} with a {@linkplain #sanitize(Response) sanitized} response.
*
* @author James R. Perkins
*/
public class ResteasyServerErrorException extends ServerErrorException implements WebApplicationExceptionWrapper {
private final ServerErrorException wrapped;
ResteasyServerErrorException(final ServerErrorException wrapped) {
super(wrapped.getMessage(), sanitize(wrapped.getResponse()), wrapped.getCause());
this.wrapped = wrapped;
}
@Override
public ServerErrorException unwrap() {
return wrapped;
}
}