Skip to content

feat: Add constants to ErrorCode for the ten error codes that EventSourcingDB 1.3 adds. - #40

Merged
goloroden merged 1 commit into
mainfrom
add-error-codes-of-1-3
Nov 10, 2026
Merged

goloroden merged 1 commit into
mainfrom
add-error-codes-of-1-3

Conversation

@goloroden

Copy link
Copy Markdown
Member

What and why

EventSourcingDB 1.3 reports ten error codes through its v2 API for which ErrorCode had no constant. DbApiException.code() already handed them on as the server sent them, but a caller could not use them in a switch over ErrorCode constants and had to write the URL out by hand.

This pull request adds a constant for each of them, each with a Javadoc comment like the existing ones and its value built from the same BASE_URL. The constants follow the order of the server's list, as the existing ones do, so they sit next to their related codes rather than at the end.

The ten new public names, for review (each named after its slug in upper snake case, as the existing 64 are):

  • SUBJECT_TOO_LONG (subject-too-long)
  • SUBJECT_TOO_DEEP (subject-too-deep)
  • EVENT_SCHEMA_TOO_COMPLEX (event-schema-too-complex)
  • BACKUP_AHEAD_OF_CLOCK (backup-ahead-of-clock)
  • IMPORT_AHEAD_OF_CLOCK (import-ahead-of-clock)
  • IMPORT_MALFORMED (import-malformed)
  • IMPORT_UNREADABLE (import-unreadable)
  • QUERY_TOO_DEEP (query-too-deep)
  • QUERY_TOO_LONG (query-too-long)
  • FILE_UNREADABLE (file-unreadable)

server-error-slugs.txt, which ErrorCodeTest reads, now holds the ten slugs as well: its block is replaced with the current one of the server, as the file asks, which differs from the previous one by exactly these ten lines. Nothing else changes; the README makes no claim about the set of constants that this would affect.

Closes #39

How it was verified

  • Added the ten slugs first: ErrorCodeTest failed, with the server listing 74 codes and ErrorCode defining 64, exactly the ten above missing.
  • Added the constants: ErrorCodeTest passes, and the order of the constants matches the order of the slugs in the list.
  • make qa passes locally (Spotless, compile with warnings as errors, Javadoc, all tests, coverage verification).

🤖 Generated with Claude Code

https://claude.ai/code/session_01FzFci8JLiwwE7sMHrJAV53

…urcingDB 1.3 adds.

EventSourcingDB 1.3 reports subject-too-long, subject-too-deep,
event-schema-too-complex, backup-ahead-of-clock, import-ahead-of-clock,
import-malformed, import-unreadable, query-too-deep, query-too-long, and
file-unreadable, for which ErrorCode had no constant, so a caller could
not use them in a switch over its constants.

The list of the server's codes that ErrorCodeTest reads now holds them
as well, and the constants follow its order, as the existing ones do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FzFci8JLiwwE7sMHrJAV53
@goloroden
goloroden requested a review from a team as a code owner November 10, 2026 14:47
@goloroden goloroden self-assigned this Nov 10, 2026
@goloroden
goloroden merged commit 2aab809 into main Nov 10, 2026
3 checks passed
@goloroden
goloroden deleted the add-error-codes-of-1-3 branch November 10, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add constants for the ten error codes of EventSourcingDB 1.3 that have none yet

1 participant