自定义异常如何不打印异常堆栈

 

重写这两个方法
@Override
public Throwable fillInStackTrace() {
   return this;
}
@Override
public String toString() {
   return MessageFormat.format("{0}[{1}]",this.retCd,this.msgDes);
}

猜你喜欢

转载自blog.csdn.net/weixin_38046780/article/details/89375314