providerexception.java

来自「这是Java学习的一些常用的例子」· Java 代码 · 共 63 行

JAVA
63
字号
package ar.com.koalas.providers;
/**
 * @author DZ156H
 */
public class ProviderException extends Exception {
    
	/** The root cause of this exception */
	protected Throwable cause;

	//~ Constructors -------------------------------------------------------------------------------
	/**
	 * Construct a <tt>ConfigurationException</tt>.
	 *
	 * @param message The exception detail message.
	 */
	public ProviderException(final String message) {
		super(message);
	}

	/**
	 * Construct a <tt>ConfigurationException</tt>.
	 *
	 * @param message The exception detail message.
	 * @param cause The detail cause of the exception.
	 */
	public ProviderException(final String message, final Throwable cause) {
		super(message);
		this.cause = cause;
	}

	/**
	 * Construct a <tt>ConfigurationException</tt>.
	 *
	 * @param cause The detail cause of the exception.
	 */
	public ProviderException(final Throwable cause) {
		super(cause.getMessage());
		this.cause = cause;
	}


	//~ Methods ------------------------------------------------------------------------------------
	/**
	 * Get the cause of the exception.
	 *
	 * @return The cause of the exception or null if there is none.
	 */
	public Throwable getCause() {
		return cause;
	}

	/**
	 * Return a string representation of the exception.
	 *
	 * @return A string representation.
	 */
	public String toString() {
		return (cause == null)
			? super.toString()
			: (super.toString() + ", Cause: " + cause);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?