Skip to content

Commit

Permalink
创建异常对象时会调用父类Throwable的fillInStackTrace()方法生成栈追踪信息,这部分对系统性能开销很大。JDk7开始…
Browse files Browse the repository at this point in the history
… 异常类增加了爬栈开关,这里同样增加构造方法方便根据业务情况自定义是否关闭和打开
  • Loading branch information
zhaolongbo committed Aug 26, 2021
1 parent ea976bc commit 40a6ffb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public DependencyException(String message, Throwable throwable) {
super(message, throwable);
}

public DependencyException( String message, Throwable throwable,boolean enableSuppression,boolean writableStackTrace) {
super(message, throwable,enableSuppression,writableStackTrace);
}

public DependencyException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public NotInitedException(String message, Throwable throwable) {
super(message, throwable);
}

public NotInitedException( String message, Throwable throwable,boolean enableSuppression,boolean writableStackTrace) {
super(message, throwable,enableSuppression,writableStackTrace);
}

public NotInitedException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public StatefulException(String msg, Throwable throwable) {
super(msg, throwable);
}

public StatefulException( String message, Throwable throwable,boolean enableSuppression,boolean writableStackTrace) {
super(message, throwable,enableSuppression,writableStackTrace);
}

public StatefulException(int status, String msg) {
super(msg);
this.status = status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public UtilException(String message, Throwable throwable) {
super(message, throwable);
}

public UtilException( String message, Throwable throwable,boolean enableSuppression,boolean writableStackTrace) {
super(message, throwable,enableSuppression,writableStackTrace);
}

public UtilException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}
Expand Down

0 comments on commit 40a6ffb

Please sign in to comment.