📄 exceptionhandle.java
字号:
package com.icbcsdc.ddlexp.pub.util;
/**
* @author zhangyc
* 处理异常信息的类
*/
public class ExceptionHandle {
/**
* Constructor for ExceptionHandle.
*/
public ExceptionHandle() {
super();
}
/**
* 该方法去掉Exception中的嵌套信息,即“** BEGIN NESTED EXCEPTION **”
* 和“** END NESTED EXCEPTION **”之间的信息。
* */
public static String getMessage(Exception e){
String errMsg=null;
String oldMsg=e.getMessage();
int pos=oldMsg.indexOf("**");
//System.out.println(oldMsg);
//System.out.println("pos:"+pos);
if(pos>=0) errMsg=oldMsg.substring(0,pos);
else errMsg=oldMsg;
return errMsg.trim();
}
public static void main(String[] args) {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -