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

java-helidon.client.libraries.mp.api_exception_mapper.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
{{>licenseInfo}}
package {{apiPackage}};

import {{rootJavaEEPackage}}.ws.rs.core.MultivaluedMap;
import {{rootJavaEEPackage}}.ws.rs.core.Response;
import {{rootJavaEEPackage}}.ws.rs.ext.Provider;

import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;

@Provider
public class ApiExceptionMapper implements ResponseExceptionMapper {

    @Override
    public boolean handles(int status, MultivaluedMap headers) {
        return status >= 400;
    }

    @Override
    public ApiException toThrowable(Response response) {
        return new ApiException(response);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy