Skip to content

Commit

Permalink
improving error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodolfo committed Jan 6, 2025
1 parent 5658058 commit c319935
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/ddl/2-append_events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ BEGIN
END LOOP;
ELSE
-- Raise an exception if sequence mismatch is detected
RAISE EXCEPTION 'Sequence mismatch: the last sequence from the database does not match the expected sequence id parameter: %.', _expected_sequence_id;
RAISE EXCEPTION 'Sequence mismatch: the current last sequence % from the database does not match the expected sequence: %.', _lastEventSequenceId, _expected_sequence_id;
END IF;

-- Return the sequence of the last event inserted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class OptimisticLockingErrorTest : AbstractCrabletTest() {
.onFailure {
testContext.verify {
it.message shouldContain
"Sequence mismatch: the last sequence from the database does not match the expected sequence id parameter: 2"
"Sequence mismatch: the current last sequence 3 from the database does not match the expected sequence: 2."
}
testContext.completeNow()
}
Expand Down

0 comments on commit c319935

Please sign in to comment.