⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 baseruntimeexception.java

📁 使用WEBWORK,SPRING,HIBERNATE编写的简单的添加
💻 JAVA
字号:
/*
 * Created on 2004-6-19
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package com.common.exception;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * @author Administrator
 * 
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class BaseRuntimeException extends RuntimeException {
	/** DOCUMENT ME! */
	private Log log = LogFactory.getLog(getClass());

	/** DOCUMENT ME! */
	private Throwable rootCause;

	/**
	 * default constructor
	 */
	public BaseRuntimeException() {
		super();
	}

	/**
	 * @param arg0
	 *            message
	 */
	public BaseRuntimeException(final String arg0) {
		//super(arg0);
		this(arg0, null);
		rootCause = this;
	}

	/**
	 * @param arg0
	 *            throwable
	 */
	public BaseRuntimeException(final Throwable arg0) {
		this("", arg0);
	}

	/**
	 * @param arg0
	 *            message
	 * @param arg1
	 *            throwable
	 */
	public BaseRuntimeException(final String arg0, final Throwable arg1) {
		super(arg0, arg1);

		if (arg1 instanceof BaseRuntimeException) {
			rootCause = ((BaseRuntimeException) arg1).rootCause;
		} else {
			rootCause = arg1;
		}

		log.error(arg0, arg1);
	}
}

⌨️ 快捷键说明

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