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

io.github.carlosthe19916.webservices.exceptions.ValidationWebServiceException Maven / Gradle / Ivy

There is a newer version: 1.3.4.Final
Show newest version
package io.github.carlosthe19916.webservices.exceptions;

import io.github.carlosthe19916.webservices.managers.SUNATCodigoErrores;
import io.github.carlosthe19916.webservices.utils.Util;

import javax.xml.ws.soap.SOAPFaultException;

public class ValidationWebServiceException extends AbstractWebServiceException {

    public ValidationWebServiceException(SOAPFaultException exception) {
        super(exception);
    }

    public Integer getSUNATErrorCode() {
        return Util.getErrorCode(exception).orElse(-1);
    }

    public String getSUNATErrorMessage() {
        Integer errorCode = getSUNATErrorCode();
        return SUNATCodigoErrores.getInstance().get(errorCode);
    }

    public String getSUNATErrorMessage(int maxLength) {
        Integer errorCode = getSUNATErrorCode();
        return SUNATCodigoErrores.getInstance().getWithMaxLength(errorCode, maxLength);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy