1   
 2 
 3 try{
 4 
 5 }catch(Exception e){
 6 if(e.getMessage().contains("123456798")) //使用e.getMessage().contains("")表示你获取的报错信息中包含哪些内容就进行if操作
 7 {
 8 
 9 }
10 else{
11 e.printStackTrace();//否则直接输出异常信息
12 }
13 }

 

相关文章:

  • 2021-10-22
  • 2021-10-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
猜你喜欢
  • 2021-09-18
  • 2021-11-23
  • 2022-01-06
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2022-01-09
相关资源
相似解决方案