From 002c1748cf118fbdbc7bd7e347dee37475cabac2 Mon Sep 17 00:00:00 2001 From: yrizhkov Date: Thu, 2 Jan 2025 11:25:55 +0200 Subject: [PATCH] adjust the phrasing of the exception message --- .../reactive/AerospikeReactiveTransactionManager.java | 10 ++++------ .../transaction/sync/AerospikeTransactionManager.java | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/springframework/data/aerospike/transaction/reactive/AerospikeReactiveTransactionManager.java b/src/main/java/org/springframework/data/aerospike/transaction/reactive/AerospikeReactiveTransactionManager.java index a9e05f2d..f1edef76 100644 --- a/src/main/java/org/springframework/data/aerospike/transaction/reactive/AerospikeReactiveTransactionManager.java +++ b/src/main/java/org/springframework/data/aerospike/transaction/reactive/AerospikeReactiveTransactionManager.java @@ -109,8 +109,8 @@ protected Mono doRollback(TransactionSynchronizationManager synchronizatio } @Override - protected Mono doSuspend(TransactionSynchronizationManager synchronizationManager, Object transaction) - throws TransactionException { + protected Mono doSuspend(TransactionSynchronizationManager synchronizationManager, + Object transaction) throws TransactionException { return Mono.fromSupplier(() -> { AerospikeReactiveTransaction aerospikeTransaction = toAerospikeTransaction(transaction); aerospikeTransaction.setResourceHolder(null); @@ -121,8 +121,7 @@ protected Mono doSuspend(TransactionSynchronizationManager synchronizati @Override protected Mono doResume(TransactionSynchronizationManager synchronizationManager, - @Nullable Object transaction, - Object suspendedResources) { + @Nullable Object transaction, Object suspendedResources) { return Mono.fromRunnable(() -> synchronizationManager.bindResource(client, suspendedResources)) .onErrorMap(e -> new TransactionSystemException("Could not resume transaction", e)) .then(); @@ -135,8 +134,7 @@ protected Mono doSetRollbackOnly(TransactionSynchronizationManager synchro AerospikeReactiveTransaction transaction = toAerospikeTransaction(status); transaction.getRequiredResourceHolder().setRollbackOnly(); }) - .onErrorMap(e -> - new TransactionSystemException("Could not set rollback only for a transaction", e)) + .onErrorMap(e -> new TransactionSystemException("Could not set transaction to rollback-only", e)) .then(); } diff --git a/src/main/java/org/springframework/data/aerospike/transaction/sync/AerospikeTransactionManager.java b/src/main/java/org/springframework/data/aerospike/transaction/sync/AerospikeTransactionManager.java index 62132551..51d61129 100644 --- a/src/main/java/org/springframework/data/aerospike/transaction/sync/AerospikeTransactionManager.java +++ b/src/main/java/org/springframework/data/aerospike/transaction/sync/AerospikeTransactionManager.java @@ -120,7 +120,7 @@ protected void doSetRollbackOnly(DefaultTransactionStatus status) throws Transac AerospikeTransaction transaction = getTransaction(status); transaction.getResourceHolderOrFail().setRollbackOnly(); } catch (Exception e) { - throw new TransactionSystemException("Could not set rollback only for a transaction", e); + throw new TransactionSystemException("Could not set transaction to rollback-only", e); } }