/**
* Kandata
* Copyright (C) 2003. Yoshinori Watanabe
* 
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* 
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Lesser General Public License for more details.
* 
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
package kandata.client;

/**
 * Kandata例外クラス.
 */
public class KandataClientException extends Exception {
	/**
	 * 例外のメッセージ.
	 * null不可能。 コンストラクタでのみ設定可能。
	 */
	protected final String message;
	/**
	 * 原因となった例外.
	 * null可能。 コンストラクタでのみ設定可能。
	 */
	protected final Throwable rootCause;

	/**
	 * 例外を作成します.
	 */
	public KandataClientException(String message, Throwable rootCause) {
		this.message = message;
		this.rootCause = rootCause;
		//System.out.println("[ERROR]"+message);
		//if (rootCause != null) rootCause.printStackTrace();
	}

	/**
	 * 例外の原因となった例外を取得します.
	 * @return 原因となった例外. <code>null</code> の場合があります。
	 */
	public Throwable getRootCause() { return rootCause; }

	/**
	 * メッセージを取得します.
	 */
	public String getMessage() { return message; }
}
