📄 commexception.java
字号:
package com.sc.util;
import java.io.*;
/**
* <p>Title: 通用的exception处理</p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author
* @version 1.0
*/
public class CommException extends Exception {
private Throwable rootCause;
public CommException() {
rootCause = null;
}
/**
* 特定异常抛出
* @param s 错误信息描述
*/
public CommException(String s) {
super(s);
rootCause = null;
}
public CommException(Throwable error){
this.rootCause = error;
}
public void setError(Throwable anException){
rootCause = anException;
}
public Throwable getRootCause(){
return rootCause;
}
public void printStackTrace(){
printStackTrace(System.err);
}
public void printStackTrace(PrintStream outStream){
printStackTrace(new PrintWriter(outStream));
}
public void printStackTrace(PrintWriter writer){
super.printStackTrace(writer);
if (getRootCause() != null){
getRootCause().printStackTrace(writer);
}
writer.flush();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -