From 0982b7bdf6dc706f8f51b31e3ede9056b08b22e0 Mon Sep 17 00:00:00 2001 From: Golo Roden Date: Fri, 23 Oct 2026 20:17:47 +0200 Subject: [PATCH 1/2] chore: Name the error code for a precondition that does not hold, rather than status 409. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CiuYmw4N6SSzfFyrwftUEj --- .../java/io/thenativeweb/eventsourcingdb/Precondition.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eventsourcingdb/src/main/java/io/thenativeweb/eventsourcingdb/Precondition.java b/eventsourcingdb/src/main/java/io/thenativeweb/eventsourcingdb/Precondition.java index 7b76f36..8272b25 100644 --- a/eventsourcingdb/src/main/java/io/thenativeweb/eventsourcingdb/Precondition.java +++ b/eventsourcingdb/src/main/java/io/thenativeweb/eventsourcingdb/Precondition.java @@ -2,7 +2,8 @@ /** * A condition that must hold for {@link Client#writeEvents(java.util.List, java.util.List)} to write events. If any of - * the preconditions does not hold, no event is written, and the server answers with status code 409. + * the preconditions does not hold, no event is written, and the client throws a {@link DbApiException} with the code + * {@link ErrorCode#PRECONDITION_VIOLATED}, whichever API the server offers. */ public sealed interface Precondition permits IsSubjectPristinePrecondition, From 2e2672f615fbd66dbef0bf18eeb64863d8aa14a4 Mon Sep 17 00:00:00 2001 From: Golo Roden Date: Fri, 23 Oct 2026 20:50:59 +0200 Subject: [PATCH 2/2] chore: Name the exception for a recursive precondition against a server without the v2 API in the Javadoc of preconditions. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CiuYmw4N6SSzfFyrwftUEj --- .../java/io/thenativeweb/eventsourcingdb/Precondition.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eventsourcingdb/src/main/java/io/thenativeweb/eventsourcingdb/Precondition.java b/eventsourcingdb/src/main/java/io/thenativeweb/eventsourcingdb/Precondition.java index 8272b25..7d18cb7 100644 --- a/eventsourcingdb/src/main/java/io/thenativeweb/eventsourcingdb/Precondition.java +++ b/eventsourcingdb/src/main/java/io/thenativeweb/eventsourcingdb/Precondition.java @@ -3,7 +3,9 @@ /** * A condition that must hold for {@link Client#writeEvents(java.util.List, java.util.List)} to write events. If any of * the preconditions does not hold, no event is written, and the client throws a {@link DbApiException} with the code - * {@link ErrorCode#PRECONDITION_VIOLATED}, whichever API the server offers. + * {@link ErrorCode#PRECONDITION_VIOLATED}, whichever API the server offers. A recursive precondition needs the v2 API, + * though: against a server without it, the client throws an {@link IncompatibleServerException} instead, and sends no + * write at all (see {@link PreconditionOptions}). */ public sealed interface Precondition permits IsSubjectPristinePrecondition,