Improve error message on <validate> failure
[netconf.git] / netconf / mdsal-netconf-connector / src / main / java / org / opendaylight / netconf / mdsal / connector / TransactionProvider.java
index 5baf6d7d311eafbbf005b0debbd204899ffd9cc6..7e2ecc8d9d9062417101aab1a94ddf07705a7f2a 100644 (file)
@@ -94,10 +94,10 @@ public class TransactionProvider implements AutoCloseable {
                 netconfSessionIdForReporting, e);
             final String cause = e.getCause() != null ? (" Cause: " + e.getCause().getMessage()) : "";
             throw new DocumentedException(
-                "Candidate transaction validate failed on " + e.getMessage() + " " + netconfSessionIdForReporting
-                    +  cause, e, ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED, ErrorSeverity.ERROR);
+                "Candidate transaction validate failed [sessionId=" + netconfSessionIdForReporting + "]: "
+                    + e.getMessage() + cause,
+                e, ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED, ErrorSeverity.ERROR);
         }
-        return;
     }
 
     public synchronized boolean commitTransaction() throws DocumentedException {