io.github.carlosthe19916.webservices.exceptions.WebServiceExceptionFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sunat-web-services Show documentation
Show all versions of sunat-web-services Show documentation
Sunat Web Services Endpoints
package io.github.carlosthe19916.webservices.exceptions;
import io.github.carlosthe19916.webservices.utils.Util;
import javax.xml.ws.soap.SOAPFaultException;
import java.util.Optional;
public class WebServiceExceptionFactory {
private WebServiceExceptionFactory() {
// Just static methods
}
public static AbstractWebServiceException createWebServiceException(SOAPFaultException e) {
Optional errorCode = Util.getErrorCode(e);
if (errorCode.isPresent()) {
return new ValidationWebServiceException(e);
} else {
return new UnknownWebServiceException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy