Repository navigation
feat: Add constants to ErrorCode for the ten error codes that EventSourcingDB 1.3 adds. - #40
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
EventSourcingDB 1.3 reports ten error codes through its v2 API for which
ErrorCodehad no constant.DbApiException.code()already handed them on as the server sent them, but a caller could not use them in aswitchoverErrorCodeconstants 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, whichErrorCodeTestreads, 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
ErrorCodeTestfailed, with the server listing 74 codes andErrorCodedefining 64, exactly the ten above missing.ErrorCodeTestpasses, and the order of the constants matches the order of the slugs in the list.make qapasses locally (Spotless, compile with warnings as errors, Javadoc, all tests, coverage verification).🤖 Generated with Claude Code
https://claude.ai/code/session_01FzFci8JLiwwE7sMHrJAV53