summaryrefslogtreecommitdiffstats
path: root/infra/data-impl/src/main/java/io
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-04-13 13:38:16 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-06-11 16:21:21 +0200
commitaedef4e46dac4b991072034ee07e3f35b6e5a700 (patch)
treed2670e825e34d1001b8bd3f1ad0a33804067c69f /infra/data-impl/src/main/java/io
parent9b39d6767724d824f7ed8070138319ff0411dabb (diff)
WriteTransaction: make sure TransactionCommitFailedException is thrown
DataTreeModification.ready() used by DataModification.validate() might throw IllegalArgumentException in case of missing mandatory nodes. Use broader Exception type in WriteTransaction.submit() to make sure contract defined by AsyncWriteTransaction is preserved. Change-Id: I95cb3e1e8c6db36df90d2c78e7d63c854189e2fd Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'infra/data-impl/src/main/java/io')
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java
index 648d4359e..8e7dca07b 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java
@@ -29,7 +29,6 @@ import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import io.fd.honeycomb.data.DataModification;
-import io.fd.honeycomb.translate.TranslationException;
import java.util.function.Consumer;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -41,7 +40,6 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -143,7 +141,7 @@ final class WriteTransaction implements DOMDataWriteTransaction {
}
status = COMMITED;
- } catch (DataValidationFailedException | TranslationException e) {
+ } catch (Exception e) {
status = FAILED;
LOG.error("Submit failed", e);
return Futures.immediateFailedCheckedFuture(