You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by ti...@apache.org on 2018/01/19 17:28:51 UTC

[aries-tx-control] 04/04: Tx Control spec compliance

This is an automated email from the ASF dual-hosted git repository.

timothyjward pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-tx-control.git

commit e1afa6ddb8be4b40bf22848d1e38840cb8bf6af2
Author: Tim Ward <ti...@apache.org>
AuthorDate: Fri Jan 19 17:27:40 2018 +0000

    Tx Control spec compliance
    
    Ensure that internal transaction management exceptions are wrapped in a spec TransactionException before being thrown to the client
---
 .../aries/tx/control/service/xa/impl/TransactionContextImpl.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 @@ public class TransactionContextImpl extends AbstractTransactionContextImpl imple
 					}
 				}
 			} 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 {

-- 
To stop receiving notification emails like this one, please contact
"commits@aries.apache.org" <co...@aries.apache.org>.