Github user miguelaferreira commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1094#discussion_r46113829
  
    --- Diff: 
engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
 ---
    @@ -671,8 +672,19 @@ public void 
doInTransactionWithoutResult(TransactionStatus status) {
                                     vpcId, offering.getRedundantRouter());
                             vo.setDisplayNetwork(isDisplayNetworkEnabled == 
null ? true : isDisplayNetworkEnabled);
                             
vo.setStrechedL2Network(offering.getSupportsStrechedL2());
    -                        networks.add(_networksDao.persist(vo, 
vo.getGuestType() == Network.GuestType.Isolated,
    -                                
finalizeServicesAndProvidersForNetwork(offering, plan.getPhysicalNetworkId())));
    +                        NetworkVO networkPersisted = 
_networksDao.persist(vo, vo.getGuestType() == Network.GuestType.Isolated,
    +                                
finalizeServicesAndProvidersForNetwork(offering, plan.getPhysicalNetworkId()));
    +                        networks.add(networkPersisted);
    +
    +                        if (predefined instanceof NetworkVO){
    +                            try{
    +                                NetworkGuruAdditionalFunctions functions = 
(NetworkGuruAdditionalFunctions) guru;
    +                                
functions.finalizeNetworkDesign(networkPersisted.getId(), 
((NetworkVO)predefined).getVlanIdAsUUID());
    +                            }
    +                            catch (Exception e){
    +                                //Couldn't cast to 
NetworkGuruAdditionalFunctions, continue
    --- End diff --
    
    The code should not catch exception because it is simply too broad.
    Caught exceptions cannot be silently ignored (i.e. having an empty `catch` 
block).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to