commit | e1afa6ddb8be4b40bf22848d1e38840cb8bf6af2 | [log] [tgz] |
---|---|---|
author | Tim Ward <timothyjward@apache.org> | Fri Jan 19 17:27:40 2018 +0000 |
committer | Tim Ward <timothyjward@apache.org> | Fri Jan 19 17:28:31 2018 +0000 |
tree | 4ffa90deb6b5df8a7a1d7ad57f458e32e0331135 | |
parent | 0553df8dbce9712a971289ed22d8493a299d6487 [diff] |
Tx Control spec compliance Ensure that internal transaction management exceptions are wrapped in a spec TransactionException before being thrown to the client
diff --git a/tx-control-services/tx-control-service-xa/src/main/java/org/apache/aries/tx/control/service/xa/impl/TransactionContextImpl.java b/tx-control-services/tx-control-service-xa/src/main/java/org/apache/aries/tx/control/service/xa/impl/TransactionContextImpl.java index 3f18dcf..fe58f84 100644 --- a/tx-control-services/tx-control-service-xa/src/main/java/org/apache/aries/tx/control/service/xa/impl/TransactionContextImpl.java +++ b/tx-control-services/tx-control-service-xa/src/main/java/org/apache/aries/tx/control/service/xa/impl/TransactionContextImpl.java
@@ -318,7 +318,9 @@ } } } catch (Exception e) { - recordFailure(e); + TransactionException te = e instanceof TransactionException ? (TransactionException) e : + new TransactionException("An error occurred in the transaction", e); + recordFailure(te); } } finally { try {