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

org.jboss.resteasy.client.exception.ResteasyNotAcceptableException Maven / Gradle / Ivy

There is a newer version: 4.0.0.Beta5
Show newest version
package org.jboss.resteasy.client.exception;

import static org.jboss.resteasy.client.exception.WebApplicationExceptionWrapper.sanitize;

import javax.ws.rs.NotAcceptableException;
import javax.ws.rs.core.Response;

/**
 * Wraps a {@link NotAcceptableException} with a {@linkplain #sanitize(Response) sanitized} response.
 *
 * @author James R. Perkins
 */
public class ResteasyNotAcceptableException extends NotAcceptableException implements WebApplicationExceptionWrapper {
    private final NotAcceptableException wrapped;

    ResteasyNotAcceptableException(final NotAcceptableException wrapped) {
        super(wrapped.getMessage(), sanitize(wrapped.getResponse()), wrapped.getCause());
        this.wrapped = wrapped;
    }

    @Override
    public NotAcceptableException unwrap() {
        return wrapped;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy