/*******************************************************************************
 * Copyright (c), 2001, 2002 N2 Broadband, Inc.  All Rights Reserved.
 *
 * This module contains unpublished, confidential, proprietary
 * material.  The use and dissemination of this material are 
 * governed by a license.  The above copyright notice does not
 * evidence any actual or intended publication of this material.
 *
 * Author:  Drake H. Henderson
 * Created:  11-12-01
 *
 ******************************************************************************/

package com.n2bb.util;

public class N2bbException extends Exception {

	/**
	 * Represents the reason for the exception.
	 */
	private String errorCode;

	/**
 	 * Constructs a <code>N2bbException</code> with the specified error code.
	 *
	 * @param   String   the spcific error code.
 	 */
	public N2bbException(String errorCode){
		super();
		this.errorCode = errorCode;
	}

	/**
	 * Constructs an <code>N2bbException</code> with the specified error code and detailed message.
	 *
	 * @param   String   the spcific error code.
	 * @param   String   the detail message.
     */
	public N2bbException(String errorCode,String exceptionMessage){
		super(exceptionMessage);
		this.errorCode = errorCode;
	}

	/**
	 * Constructs an <code>N2bbException</code> with the specified error code and detailed message.
	 *
	 * @param   String   the spcific error code.
	 * @param   Exception   java.lang.Exception.
     */
	public N2bbException(String errorCode, Exception exception){
		super(exception.toString());
		this.errorCode = errorCode;
	}

	/**
	 * This method sets the errorCode.
	 *
	 * @param   String   the spcific error code.
	 */
	public void setErrorCode(String errorCode){
		this.errorCode = errorCode;
	}

	/**
	 * This method gets the errorCode.
	 *
	 * @return String the error code.
	 */
	public String getErrorCode(){
		return errorCode;
	}
}
