Skip to content

Commit

Permalink
adjust the phrasing of the exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
reugn committed Jan 2, 2025
1 parent 1f1faa3 commit 002c174
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ protected Mono<Void> doRollback(TransactionSynchronizationManager synchronizatio
}

@Override
protected Mono<Object> doSuspend(TransactionSynchronizationManager synchronizationManager, Object transaction)
throws TransactionException {
protected Mono<Object> doSuspend(TransactionSynchronizationManager synchronizationManager,
Object transaction) throws TransactionException {
return Mono.fromSupplier(() -> {
AerospikeReactiveTransaction aerospikeTransaction = toAerospikeTransaction(transaction);
aerospikeTransaction.setResourceHolder(null);
Expand All @@ -121,8 +121,7 @@ protected Mono<Object> doSuspend(TransactionSynchronizationManager synchronizati

@Override
protected Mono<Void> 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();
Expand All @@ -135,8 +134,7 @@ protected Mono<Void> 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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 002c174

Please sign in to comment.