📄 nestedexceptionutils.java.svn-base
字号:
package com.easyjf.web.exception;
/**
* Helper class for implementing exception classes which are capable of
* holding nested exceptions. Necessary because we can't share a base
* class among different exception types.
*
* <p>Mainly for use within the framework.
*
* @author Juergen Hoeller
* @since 2.0
* @see NestedRuntimeException
* @see NestedCheckedException
* @see NestedIOException
* @see org.springframework.web.util.NestedServletException
*/
public abstract class NestedExceptionUtils {
/**
* Build a message for the given base message and root cause.
* @param message the base message
* @param cause the root cause
* @return the full exception message
*/
public static String buildMessage(String message, Throwable cause) {
if (cause != null) {
StringBuffer buf = new StringBuffer();
if (message != null) {
buf.append(message).append("; ");
}
buf.append("nested exception is ").append(cause);
return buf.toString();
}
else {
return message;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -