我一般在项目里,业务层的方法报错都会直接往上抛到控制层来做统一的处理,一般来说,有经验的开发者会选择这样的异常处理方法吗?
如果不这样做,那么一般怎样做?
天蓬老师2017-05-17 10:10:28
Why should we throw it into the control layer? Different field types will affect your business direction, so I usually unified convergence exceptions at the service layer.
怪我咯2017-05-17 10:10:28
When there is a transaction, I will throw the exception to the control layer for processing, otherwise it may affect the rollback of the transaction