Commit 8a094cca by qiuweili123

异常策略优化

parent eccb2f96
...@@ -8,11 +8,15 @@ public abstract class AbsExceptionProcessor implements ExceptionProcessor { ...@@ -8,11 +8,15 @@ public abstract class AbsExceptionProcessor implements ExceptionProcessor {
public void process(Exception e) throws Exception { public void process(Exception e) throws Exception {
convertException(e); convertException(e);
//如果不进行友好的异常转换,包装为统一的错误异常抛出 //如果不进行运行时异常抛出,则转换为运行时异常
if (!(e instanceof RuntimeException)) {
log.error("error:", e); log.error("error:", e);
throw new SystemInternalException(); throw new SystemInternalException();
} }
throw e;
}
protected abstract void convertException(Exception e); protected abstract void convertException(Exception e);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment