falkordb 6.9.1 → 6.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,12 +14,15 @@ function parseCommand(parser, graph, query, options, compact, version) {
|
|
|
14
14
|
function transformArguments(graph, query, options, compact, version) {
|
|
15
15
|
return (0, _1.pushQueryArguments)(['GRAPH.QUERY'], graph, query, options, compact, version);
|
|
16
16
|
}
|
|
17
|
+
// How the server words the rejection of a stale `version`: the C engine says
|
|
18
|
+
// `version mismatch`, the Rust engine `ERR invalid graph version`
|
|
19
|
+
const VERSION_MISMATCH = /^(?:ERR )?(?:version mismatch|invalid graph version)$/;
|
|
17
20
|
function transformReply(reply) {
|
|
18
21
|
// A query sent with a stale `version` is rejected with
|
|
19
|
-
// `[error
|
|
22
|
+
// `[error, current version]` and not executed
|
|
20
23
|
const [first, second] = reply;
|
|
21
24
|
if (first instanceof Error) {
|
|
22
|
-
if (first.message
|
|
25
|
+
if (VERSION_MISMATCH.test(first.message)) {
|
|
23
26
|
throw new errors_1.SchemaVersionMismatchError(second);
|
|
24
27
|
}
|
|
25
28
|
throw first;
|