84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
我一般在项目里,业务层的方法报错都会直接往上抛到控制层来做统一的处理,一般来说,有经验的开发者会选择这样的异常处理方法吗? 如果不这样做,那么一般怎样做?
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.
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
Usually it is handled directly in the service
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.
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
Usually it is handled directly in the service