#286 add hystrix demo back, 最后一轮代码清理。
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断异常是否由某些底层的异常引起.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user