Skip to content

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

Open
tae898 wants to merge 1 commit into
mainfrom
fix/507-error-subclass-codes
Open

tae898 wants to merge 1 commit 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

…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.
@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

This branch has not been deployed

No deployments
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