From 67cfa8083646757fe64b5fa9bf4f3f3a89796ef9 Mon Sep 17 00:00:00 2001 From: cybermaggedon Date: Mon, 13 Apr 2026 14:31:33 +0100 Subject: [PATCH] SPARQL CLI reports errors from service (#794) SPARQL query CLI ignores errors from the SPARQL service and just emits a zero row output. This change causes an error to be reported --- trustgraph-cli/trustgraph/cli/invoke_sparql_query.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/trustgraph-cli/trustgraph/cli/invoke_sparql_query.py b/trustgraph-cli/trustgraph/cli/invoke_sparql_query.py index 82e48456..7b1ae9a6 100644 --- a/trustgraph-cli/trustgraph/cli/invoke_sparql_query.py +++ b/trustgraph-cli/trustgraph/cli/invoke_sparql_query.py @@ -62,6 +62,11 @@ def sparql_query(url, token, flow_id, query, user, collection, limit, limit=limit, batch_size=batch_size, ): + if "error" in response: + err = response["error"] + msg = err.get("message", err) if isinstance(err, dict) else err + raise RuntimeError(msg) + query_type = response.get("query-type", "select") # ASK queries - just print and return