Handle exception when installing fails
- Catch an IntentException in InstallCoordinating and Installing
- Remove FlowRuleBatchOperationConvertionException because it is unused
Change-Id: I99cf07df811ba8489feb75088f83ddc4ebd93c9e
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/InstallCoordinating.java b/core/net/src/main/java/org/onosproject/net/intent/impl/InstallCoordinating.java
index e21b2fa..f259595 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/InstallCoordinating.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/InstallCoordinating.java
@@ -17,6 +17,7 @@
import org.onosproject.net.flow.FlowRuleOperations;
import org.onosproject.net.intent.IntentData;
+import org.onosproject.net.intent.IntentException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,9 +49,9 @@
try {
FlowRuleOperations flowRules = intentManager.coordinate(pending);
return Optional.of(new Installing(intentManager, pending, flowRules));
- } catch (FlowRuleBatchOperationConversionException e) {
- log.warn("Unable to install intent {} due to:", pending.intent().id(), e.getCause());
- return Optional.of(new InstallingFailed(pending)); //FIXME
+ } catch (IntentException e) {
+ log.warn("Unable to generate a FlowRuleOperations from intent {} due to:", pending.intent().id(), e);
+ return Optional.of(new InstallingFailed(pending));
}
}
}