From 52725324973f22ac0c85ed4fd8459cf0ef504407 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Mon, 21 May 2018 12:07:51 -0400 Subject: [PATCH] Add path context to data validation failures JIRA: CONTROLLER-1830 Change-Id: I588303ef2bbe01f8267da32b6b37d327dcbfbeb4 Signed-off-by: Tom Pantelis --- .../controller/cluster/datastore/ShardDataTree.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java index 5459cfa9ab..e8b41d9747 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java @@ -737,7 +737,7 @@ public class ShardDataTree extends ShardDataTreeTransactionParent { } catch (ConflictingModificationAppliedException e) { LOG.warn("{}: Store Tx {}: Conflicting modification for path {}.", logContext, cohort.getIdentifier(), e.getPath()); - cause = new OptimisticLockFailedException("Optimistic lock failed.", e); + cause = new OptimisticLockFailedException("Optimistic lock failed for path " + e.getPath(), e); } catch (DataValidationFailedException e) { LOG.warn("{}: Store Tx {}: Data validation failed for path {}.", logContext, cohort.getIdentifier(), e.getPath(), e); @@ -746,7 +746,7 @@ public class ShardDataTree extends ShardDataTreeTransactionParent { // precondition log, it should allow us to understand what went on. LOG.debug("{}: Store Tx {}: modifications: {} tree: {}", cohort.getIdentifier(), modification, dataTree); - cause = new TransactionCommitFailedException("Data did not pass validation.", e); + cause = new TransactionCommitFailedException("Data did not pass validation for path " + e.getPath(), e); } catch (Exception e) { LOG.warn("{}: Unexpected failure in validation phase", logContext, e); cause = e; -- 2.36.6