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/Installing.java b/core/net/src/main/java/org/onosproject/net/intent/impl/Installing.java
index 205345c..122f224 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/Installing.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/Installing.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,8 +49,10 @@
try {
intentManager.flowRuleService.apply(flowRules); // FIXME we need to provide a context
return Optional.of(new Installed(pending));
- } catch (FlowRuleBatchOperationConversionException e) {
- log.warn("Unable to install intent {} due to:", pending.intent().id(), e.getCause());
+ // What kinds of exceptions are thrown by FlowRuleService.apply()?
+ // Is IntentException a correct exception abstraction?
+ } catch (IntentException e) {
+ log.warn("Unable to install intent {} due to: {}", pending.intent().id(), e);
return Optional.of(new InstallingFailed(pending));
}
}