public static void main(String[] args) {
try{
int i = 100/ 100;
System.out.print(i);
if(i==1){
throw new BizException(OrderErrorEnum.CAN_NOT_GET_CONTRACT_CODE_ERROR);
}
}catch (Exception e){
System.out.println(e);
throw new BizException(OrderErrorEnum.CAN_NOT_SUBMIT_COMPLETE_ERROR);
}
}
//try中有异常时throw,catch中无异常时,throw try中的异常
注释掉catch中显示CAN_NOT_GET_CONTRACT_CODE_ERROR
//catch 中可以throw new 一个新的异常,会将try中的异常捕获输出CAN_NOT_SUBMIT_COMPLETE_ERROR