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

it.auties.whatsapp.exception.RegistrationException Maven / Gradle / Ivy

package it.auties.whatsapp.exception;

import it.auties.whatsapp.model.response.VerificationCodeResponse;

import java.util.Optional;

/**
 * This exception is thrown when a phone number cannot be registered by the Whatsapp API
 */
public class RegistrationException extends RuntimeException {
    private final VerificationCodeResponse erroneousResponse;

    public RegistrationException(VerificationCodeResponse erroneousResponse, String message) {
        super(message);
        this.erroneousResponse = erroneousResponse;
    }

    public Optional erroneousResponse() {
        return Optional.ofNullable(erroneousResponse);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy