From 8edcc25ab0d28ac2219d3802663f183b43350010 Mon Sep 17 00:00:00 2001 From: Taewoon Kim Date: Thu, 3 Dec 2026 11:44:36 +0900 Subject: [PATCH] Error codes: ReadOnlyScope$WriteRefusedException (a subclass of QueryNotIdempotentException in the engine snapshot) gets query_not_idempotent; the decision test of #544 was red on the CI wheel without it --- docs/modules/ROOT/pages/how-to/errors.adoc | 2 +- src/arcadedb/exceptions.py | 5 ++++- tests/test_error_codes_table.py | 13 +++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/modules/ROOT/pages/how-to/errors.adoc b/docs/modules/ROOT/pages/how-to/errors.adoc index ea8df25f..5249834f 100644 --- a/docs/modules/ROOT/pages/how-to/errors.adoc +++ b/docs/modules/ROOT/pages/how-to/errors.adoc @@ -216,7 +216,7 @@ Each row gives one hint, and a code that has more than one cause has a row for e | `query_not_idempotent` | `ArcadeDBError` -| `QueryNotIdempotentException` +| `QueryNotIdempotentException`, `ReadOnlyScope$WriteRefusedException` | `db.query` runs reads only: send a statement that changes data with `db.command`. | `missing_parameter` diff --git a/src/arcadedb/exceptions.py b/src/arcadedb/exceptions.py index 19532cd8..ef6ec1fd 100644 --- a/src/arcadedb/exceptions.py +++ b/src/arcadedb/exceptions.py @@ -599,7 +599,10 @@ class _Rule(NamedTuple): "query_not_idempotent", ArcadeDBError, "`db.query` runs reads only: send a statement that changes data with `db.command`.", - java=(_E + "QueryNotIdempotentException",), + java=( + _E + "QueryNotIdempotentException", + "com.arcadedb.database.ReadOnlyScope$WriteRefusedException", + ), ), _Rule( "missing_parameter", diff --git a/tests/test_error_codes_table.py b/tests/test_error_codes_table.py index 3e52669b..1a3b4f22 100644 --- a/tests/test_error_codes_table.py +++ b/tests/test_error_codes_table.py @@ -341,6 +341,19 @@ "query_not_idempotent", E + "QueryNotIdempotentException", ), + ( + "query_not_idempotent", + "Query failed: com.arcadedb.database.ReadOnlyScope$WriteRefusedException: a read-only scope refused a write", + [ + ( + "com.arcadedb.database.ReadOnlyScope$WriteRefusedException", + "a read-only scope refused a write", + ) + ], + "ArcadeDBError", + "query_not_idempotent", + "com.arcadedb.database.ReadOnlyScope$WriteRefusedException", + ), ( "missing_parameter", "Query failed: com.arcadedb.exception.CommandParameterMissingException: Expected parameter(s): x",