#286 add hystrix demo back, 最后一轮代码清理。

This commit is contained in:
Calvin
2013-10-18 00:19:33 +08:00
parent c415034fc6
commit cdaebd63a2
10 changed files with 92 additions and 72 deletions
@@ -35,6 +35,16 @@ public class Exceptions {
return stringWriter.toString();
}
/**
* 获取组合本异常信息与底层异常信息的异常描述, 适用于本异常为统一包装异常类,底层异常才是根本原因的情况。
*/
public static String getErrorMessageWithNested(Exception e) {
Throwable nestedException = e.getCause();
return new StringBuilder().append(e.getMessage()).append(" nested exception is ")
.append(nestedException.getClass().getName()).append(":").append(nestedException.getMessage())
.toString();
}
/**
* 判断异常是否由某些底层的异常引起.
*/