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",