Skip to content

Error codes: give each engine subclass of a listed exception a code or a recorded reason (27.1.1) - #544

Merged
tae898 merged 2 commits into
mainfrom
fix/507-error-subclass-codes
Dec 3, 2026
Merged

tae898 merged 2 commits into
mainfrom
fix/507-error-subclass-codes

Conversation

@tae898

@tae898 tae898 commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

The table of error codes compares Java class names exactly, so a subclass of a listed engine exception came out as unknown, with no hint. Each such subclass now has a row with a hint that fits, or a recorded reason to stay unknown. The jars of engine 26.12.1-SNAPSHOT hold more of them than the issue lists, including some below IllegalArgumentException.

Please do not merge yet. I still have to decide whether this goes into 26.12.1.

Engine exception (was unknown unless a message rule caught it) Code now
CommandSemanticException, NonBooleanPatternExpressionException, FeatureNotImplementedException syntax_error
RecordVetoedException validation
DatabaseIsReopeningException database_closed
RefusedBeforePublishingException, QuorumNotReachedException, ReplicationQueueFullException, ServerIsNotTheLeaderException, RetryLaterException, WALVersionGapException conflict
EquivalentIndexException already_exists, with its own hint
ConstraintDropFailedException, IndexDropFailedException schema
Type$InconvertibleValueException, ValueOutOfRangeException, InvalidPropertyTypeException type_mismatch
DatabaseAlreadyExistsException (server) database_exists

The ones that stay unknown, each with its reason, are in STAYS_UNKNOWN in tests/test_error_codes_subclasses.py.

What changes for a caller: these errors get a code, a hint, and a subclass of ArcadeDBError, so str(e) now starts with [code] hint. Code that compares e.code == "unknown" for one of them sees the new code. Which errors run_in_transaction retries does not change.

The new test reads the class files of the jars in the JVM wheel. It fails when a newer engine adds a subclass of a listed class that nobody has decided on, so a nightly or pull request run against a new snapshot can turn red for that reason alone. Anonymous classes are left out.

Related issues

Closes #507

Performance changes

None claimed. The table is only read when an error is built.

Docs

how-to/errors.adoc: the new rows, and a sentence on exact class names and on which conflict a retry may not fix.

Checklist

  • A regression test fails on the old code and passes on the new (on main the new test file gave 6 failed and 2 passed)
  • The test suite that the change can affect passes (see the checks)
  • uvx pre-commit run --files <changed files> passes

@tae898 tae898 added bug Something isn't working python Pull requests that update python code native The arcadedb package (native library build) jvm The arcadedb-jvm package (JPype build) labels Nov 29, 2026
@tae898 tae898 self-assigned this Nov 29, 2026
tae898 added a commit that referenced this pull request Nov 30, 2026
…ed error subclass; to_json() text per build (#549)

#543 and #544 are held for the 26.12.1 decision, so the pages state the
behaviour without them, each with a REMOVE WHEN comment. The which-package
table gains the to_json() row of #545/#546 and points to to_json_list().
@tae898 tae898 mentioned this pull request Nov 30, 2026
1 of 10 tasks
@tae898 tae898 added this to the 27.1.1 milestone Nov 30, 2026
@tae898

tae898 commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator Author

Decided on 2026-11-30, as the current decision and open to change: this stays out of 26.12.1 and moves to 27.1.1, with #507. I set the milestone. It rests on what the change does: callers get a new code for these engine exceptions where they got unknown, and the new test turns a run red whenever a newer engine adds a subclass that nobody has decided on, which fits the start of a release cycle better than its last days. The hold on merging stands.

@tae898 tae898 changed the title Error codes: give each engine subclass of a listed exception a code or a recorded reason (hold: 26.12.1 decision) Error codes: give each engine subclass of a listed exception a code or a recorded reason (27.1.1) Nov 30, 2026
@tae898
tae898 force-pushed the fix/507-error-subclass-codes branch from dbecbab to 18570c1 Compare December 2, 2026 15:02
@tae898

tae898 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

I pushed a commit that fixes the red tests without a release: on a locally built JVM wheel of the 26.12.1 snapshot (26.12.1.dev0) the three error-code test files now pass (173 passed). There were five red tests, not four: a STAYS_UNKNOWN reason for UserCodeNestingException, the table test compares the class of a code and not its hint (DatabaseIsReopeningException has its own), the Cypher pattern failure now comes as CommandParsingException, the type conversion failure now comes as IllegalArgumentException, and the engine refuses CREATE INDEX ... IF NOT EXISTS under a second name, so the already_exists hint no longer says to add IF NOT EXISTS. The hold on merging stands.

…rd why it stays unknown

The table compares Java class names exactly, so a subclass of a listed class came out as unknown. Rows now name the subclasses with a hint that fits, and a test reads the class files of the wheel's jars and fails on an engine subclass that has neither a row nor a recorded reason.
Five red tests on the snapshot engine: UserCodeNestingException gets a STAYS_UNKNOWN reason; the table test compares the class of a code (its name) and no longer the hint, since DatabaseIsReopeningException has its own; the open-cypher pattern failure now comes as CommandParsingException; Type conversion failures now come as IllegalArgumentException; and the engine refuses CREATE INDEX IF NOT EXISTS under a second name for the same properties, so the already_exists hint no longer promises IF NOT EXISTS. Run on a locally built JVM wheel (26.12.1.dev0) with the source on PYTHONPATH: 173 passed.
@tae898
tae898 force-pushed the fix/507-error-subclass-codes branch from f385df2 to 807f2b2 Compare December 2, 2026 16:21
@tae898
tae898 merged commit fab924f into main Dec 3, 2026
26 checks passed
@tae898
tae898 deleted the fix/507-error-subclass-codes branch December 3, 2026 02:27
tae898 added a commit that referenced this pull request Dec 3, 2026
…NotIdempotentException in the engine snapshot) gets query_not_idempotent; the decision test of #544 was red on the CI wheel without it (#572)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working jvm The arcadedb-jvm package (JPype build) native The arcadedb package (native library build) python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error codes: a subclass of a listed engine exception comes out as unknown

1 participant