Skip to content

Commit b44f735

Browse files
committed
chore(server/sessions): modify read conflict error message
Signed-off-by: Michele Meloni <[email protected]>
1 parent 24ff2e5 commit b44f735

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/integration/transaction_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func TestTransaction_MultiNoErr(t *testing.T) {
260260
err = tx.SQLExec(updateStmt(1, 10))
261261
require.NoError(t, err)
262262
_, err = tx.Commit(ctx)
263-
require.EqualError(t, err, "only one read write transaction allowed at time")
263+
require.EqualError(t, err, "tx read conflict")
264264
require.Equal(t, err.(errors.ImmuError).Code(), errors.CodInFailedSqlTransaction)
265265

266266
txn, err := client.NewTx(ctx)

pkg/server/errors.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var (
4848
ErrNoSessionIDPresent = errors.New("no sessionID provided")
4949
ErrTxNotProperlyClosed = errors.New("tx not properly closed")
5050
ErrReadWriteTxNotOngoing = errors.New("read write transaction not ongoing")
51-
ErrOnlyOneReadWriteTxAllowed = errors.New("only one read write transaction allowed at time").WithCode(errors.CodInFailedSqlTransaction)
51+
ErrTxReadConflict = errors.New(store.ErrTxReadConflict.Error()).WithCode(errors.CodInFailedSqlTransaction)
5252
)
5353

5454
func mapServerError(err error) error {
@@ -58,7 +58,7 @@ func mapServerError(err error) error {
5858
case store.ErrIllegalArguments:
5959
return ErrIllegalArguments
6060
case store.ErrTxReadConflict:
61-
return ErrOnlyOneReadWriteTxAllowed
61+
return ErrTxReadConflict
6262
}
6363
return err
6464
}

0 commit comments

Comments
 (0)