
package org.jivesoftware.smack.parsing;

import org.jivesoftware.smack.UnparseableStanza;

/**
 * Interface to receive parsing exceptions.
 * <p>
 * If this class is used as callback, then Smack will silently ignore the stanza that caused the parsing exception and
 * place the parser after the faulty stanza.
 * </p>
 * <p>
 * Smack provides 2 predefined ParsingExceptionCallback's: {@link ExceptionLoggingCallback} and {@link ExceptionThrowingCallback}.
 * </p>
 * 
 * @author Florian Schmaus
 * 
 */
public interface ParsingExceptionCallback {

    /**
     * Called when parsing a stanza caused an exception.
     * 
     * @param stanzaData the raw stanza data that caused the exception
     * @throws Exception
     */
    public void handleUnparsableStanza(UnparseableStanza stanzaData) throws Exception;

}
