package anastore.util;

import anastore.net.Message;

/**
 * An exception that is thrown to indicate a violation of expected
 * protocol, such as the receipt of an unexpected message type.
 */
public class ProtocolViolationException extends RuntimeException
{
    public ProtocolViolationException(Message msg)
    {
        super(msg.toString());
    }

    public ProtocolViolationException(Message msg, String message)
    {
        super(msg + ": " + message);
    }

    public ProtocolViolationException(String message)
    {
        super(message);
    }

    public ProtocolViolationException(String message, Throwable cause)
    {
        super(message, cause);
    }

    public ProtocolViolationException(Throwable cause)
    {
        super(cause);
    }
}
