zoukankan      html  css  js  c++  java
  • trycatch 只包含容易出异常的地方

       private void addOnce(
                Shop shop) {
           
            try {
                  ChainStoreAddRequest request = new ChainStoreAddRequest();
    
            ChainStoreAddInfo chainStoreAddInfo = new ChainStoreAddInfo();
            chainStoreAddInfo.setName(shop.getShopName());
            chainStoreAddInfo.setContactPhone(shop.getPhoneNum());
            chainStoreAddInfo.setAddress(shop.getAddress());
            chainStoreAddInfo.setLongitude(shop.getLongitude().toString());
            chainStoreAddInfo.setLatitude(shop.getLatitude().toString());
    
            request.setChainStore(chainStoreAddInfo);
                ChainStoreAddResponse response = client.execute(request);
    
                System.out.println(response.getData());
            } catch (Exception e) {
                System.out.println(e);
            }
        }
    
    
    
    
     private void addOnce(
                Shop shop) {
            ChainStoreAddRequest request = new ChainStoreAddRequest();
    
            ChainStoreAddInfo chainStoreAddInfo = new ChainStoreAddInfo();
            chainStoreAddInfo.setName(shop.getShopName());
            chainStoreAddInfo.setContactPhone(shop.getPhoneNum());
            chainStoreAddInfo.setAddress(shop.getAddress());
            chainStoreAddInfo.setLongitude(shop.getLongitude().toString());
            chainStoreAddInfo.setLatitude(shop.getLatitude().toString());
    
            request.setChainStore(chainStoreAddInfo);
    
            try {
                ChainStoreAddResponse response = client.execute(request);
    
                System.out.println(response.getData());
            } catch (Exception e) {
                System.out.println(e);
            }
        }
  • 相关阅读:
    ubuntu16.04解决播放swf视频文件问题
    ubuntu下设置clion是使用clang和clang++
    Linux 下没有conio.h 已解决
    适合最新版docker自定义启动配置
    nginx限制ip并发数
    nginx 403错误
    ubuntu 支持中文
    CentOS 5 上使用yum同时安装32位和64位包的解决方法
    rhel yum报错
    因为swap分区无法启动
  • 原文地址:https://www.cnblogs.com/loserchange/p/8317059.html
Copyright © 2011-2022 走看看