exceptionutil.java
来自「struts+spring+hibernate自创框架」· Java 代码 · 共 31 行
JAVA
31 行
package com.pegasus.framework.util;
/**
* The Class ExceptionFormater.
*/
public final class ExceptionUtil {
/**
* Format.
*
* @param e the e
*
* @return the object
*/
public static Object format(Exception e) {
return formatTrace(e);
}
public static Object formatTrace(Throwable e) {
StackTraceElement[] trace = e.getStackTrace();
StringBuffer buffer = new StringBuffer("\n");
buffer.append(e);
for (int i = 0; i < trace.length; i++) {
buffer.append("\n\tat ").append(trace[i]);
}
return buffer;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?