Skip to content

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

In review

Description

@tae898

The error table in exceptions.py compares Java class names exactly. A subclass of a listed class therefore gets the code unknown and no hint, unless a rule on the message text catches it. I want each such class to get the right code, so that except clauses and hints work for it.

Engine exception Subclass of Code of the parent New since 2026-11-06
NonBooleanPatternExpressionException (openCypher pattern used outside a boolean position) CommandParsingException syntax_error yes (engine PR 11894)
CommandSemanticException CommandParsingException syntax_error no
FeatureNotImplementedException CommandParsingException syntax_error no
RecordVetoedException (a listener vetoed a write) ValidationException validation no
DatabaseIsReopeningException DatabaseIsClosedException database_closed no
WALVersionGapException ConcurrentModificationException conflict no
RefusedBeforePublishingException (high availability) NeedRetryException conflict yes

Also new: EquivalentIndexException, raised for example when CREATE INDEX gives a second name to properties that are already indexed (engine PR 11454). The table has no row for it, and had none for the plain exception that was raised before. The already_exists hint ("choose another name") would be wrong for it, so it needs its own wording if it gets a code.

Done when:

  • Each class above, EquivalentIndexException included, has a code with a hint that fits, or a recorded reason to stay unknown.
  • Both packages give the same answer, and the table in how-to/errors.adoc matches.
  • A test fails when the engine adds a subclass of a listed class that nobody has decided on.

Found while reviewing #503. From reading exceptions.py and the engine source at 8851991e1; I have not run these failures.

Activity

  1. added this to the 27.1.1 milestone on Nov 27, 2026
  2. self-assigned this
    on Nov 27, 2026
  3. added
    bug
    native
    jvm
    on Nov 27, 2026
  4. added
    in progress
    on Nov 29, 2026
  5. tae898 commented on Nov 30, 2026

    @tae898
    CollaboratorAuthor

    Three more subclasses came with the engine changes of #551 (upstream 2026-11-27 to 2026-11-30). Two of them change a code between 26.11.1 and 26.12.1:

    Engine exception Subclass of Raised by 26.11.1 26.12.1
    IndexDropFailedException (PR 13703) SchemaException openCypher DROP INDEX of a missing name schema unknown
    ConstraintDropFailedException (PR 13703) SchemaException openCypher DROP CONSTRAINT of a missing name schema unknown
    ProcedureCallFailedException (PR 13565) IllegalArgumentException a failed apoc.util.validate unknown unknown

    I checked the first two over HTTP on the 26.12.1-SNAPSHOT image build 0b058e985: the answers name the new classes, and SQL DROP INDEX still raises SchemaException. The third threw a plain IllegalArgumentException before, which the type_mismatch row matches only on "Cannot convert type", so its code does not change. #552 documents the 26.12.1 behaviour until this issue is decided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugin progressjvmnative

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions