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);
            }
        }
  • 相关阅读:
    编程总结3
    编程总结2
    编程总结1
    对我影响最深的老师
    自我介绍
    BFC 规则及解决的问题?
    简述 CSS 精灵图原理,及优缺点?
    等高布局、圣杯布局、双飞翼布局的实现原理
    CSS 基本选择器有哪些?
    CSS 引入方式有哪些?
  • 原文地址:https://www.cnblogs.com/loserchange/p/8317059.html
Copyright © 2011-2022 走看看