| 限定符和类型 | 方法和说明 |
|---|---|
static String |
buildMessage(int code,
Object[] args,
String customMessage,
Throwable cause) |
static String |
buildNestedMessage(String message,
Throwable ex) |
static String |
buildNestedMessage(Throwable ex) |
static String |
buildStackTrace(Throwable cause) |
static Source |
extractSource(List<SourceExtractor> sourceExtractors,
Throwable ex) |
static String |
getExceptionMessage(Exception ex)
因为ex.printStackTrace参数只有个PrintWriter类型的,java自带的StringWriter
不可用,所以我们需要自己实现一个装饰器类。
|
static Throwable |
getRootCause(Throwable cause) |
static int |
parseCode(Throwable cause) |
static Exception |
raw(Exception ex) |
static void |
throwEx(Throwable ex) |
static void |
throwRoot(Exception e) |
static Map<String,Object> |
toMap(Exception ex) |
static AppException |
wrap(Throwable ex) |
public static AppException wrap(Throwable ex)
public static void throwEx(Throwable ex)
public static void throwRoot(Exception e)
public static int parseCode(Throwable cause)
public static String buildMessage(int code, Object[] args, String customMessage, Throwable cause)
public static Source extractSource(List<SourceExtractor> sourceExtractors, Throwable ex)
Copyright © 2020. All rights reserved.