一、如果用到了try-catch,需要在catch中再次抛出RuntimeException("")异常
@Transactional(rollbackFor=Exception.class)
public CommonResult anecdoterecordsServiceSave(Anecdoterecords anecdoterecords, HttpServletRequest request, String picMvIds) throws Exception {
try {
...
int aaaaaaa = 10;
int bbbbbbb = 0;
if(aaaaaaa/bbbbbbb == 100){
System.err.println("哈哈哈哈哈哈哈哈哈");
}
return something;
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
}