Add path context to data validation failures
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardDataTree.java
index 5459cfa9ab1ba1d3379efc2b2835cd1056251bc5..e8b41d97474f49951b8b67846d22c7a06b73d185 100644 (file)
@@ -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;