Clean up MDSALManager exception handling
[netvirt.git] / natservice / impl / src / main / java / org / opendaylight / netvirt / natservice / internal / NatEvpnUtil.java
index 5cdaa7bf27905c74030858ba59a91afa6582201d..0044863561a457f7c65232e03ef5c4dd96b2170f 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.netvirt.natservice.internal;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -221,11 +220,9 @@ public final class NatEvpnUtil {
                 l3GwMacTableFlowEntity, dpnId);
     }
 
-    // TODO skitt Fix the exception handling here
-    @SuppressWarnings("checkstyle:IllegalCatch")
-    @SuppressFBWarnings("REC_CATCH_EXCEPTION")
     static void removeL3GwMacTableEntry(final BigInteger dpnId, final long vpnId, final String macAddress,
-        IMdsalApiManager mdsalManager, TypedReadWriteTransaction<Configuration> confTx) {
+            IMdsalApiManager mdsalManager, TypedReadWriteTransaction<Configuration> confTx)
+            throws ExecutionException, InterruptedException {
         List<MatchInfo> matchInfo = new ArrayList<>();
         matchInfo.add(new MatchMetadata(MetaDataUtil.getVpnIdMetadata(vpnId), MetaDataUtil.METADATA_MASK_VRFID));
         matchInfo.add(new MatchEthernetSource(new MacAddress(macAddress)));
@@ -237,12 +234,7 @@ public final class NatEvpnUtil {
         Flow l3GwMacTableFlowEntity = MDSALUtil.buildFlowNew(NwConstants.L3_GW_MAC_TABLE,
                 flowRef, 21, flowRef, 0, 0, NwConstants.COOKIE_L3_GW_MAC_TABLE, matchInfo, null);
 
-        try {
-            mdsalManager.removeFlow(confTx, dpnId, l3GwMacTableFlowEntity);
-        } catch (Exception e) {
-            LOG.error("Error removing flow", e);
-            throw new RuntimeException("Error removing flow", e);
-        }
+        mdsalManager.removeFlow(confTx, dpnId, l3GwMacTableFlowEntity);
         LOG.debug("removeL3GwMacTableEntry : Successfully removed flow entity {} on DPN = {}",
                 l3GwMacTableFlowEntity, dpnId);
     }