/*
 * @(#)NntpException.java
 *
 * Copyright (c) 2001-2002 JScape
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JScape. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JScape.
 */
package com.jscape.inet.nntp;


/**
 * NntpException is thrown by many methods of Nntp class.  The methods are
 * masking various exception types into NntpException, but the event message
 * will be propagated. <br>
 * In case that the cause for throwing NntpException is not exception but
 * invalid client operation or server response, NntpException message will
 * contain textual part of server response.
 */
public class NntpException
        extends Exception {

    /**
     * Creates exception with specified message string.
     *
     * @param message the message of exception
     */
    public NntpException(String message) {
        super(message);
    }

    /**
     * NntpException is thrown by many methods of Nntp class. The methods are
     * masking various exception types into NntpException, but the event
     * message will be propagated. In case that the cause for throwing
     * NntpException is not exception but invalid client operation or server
     * response, NntpException message will contain textual part of server
     * response.
     *
     * @param message   the message of exception
     * @param cause the source of this exception
     */
    public NntpException(String message, Throwable cause) {
        super(message, cause);
    }

    public NntpException(Throwable cause) {
        super(cause.getMessage() != null ? cause.getMessage() : cause.toString(), cause);
    }
}
