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
This commit is contained in:
cybermaggedon 2026-04-13 14:31:33 +01:00 committed by GitHub
parent ffe310af7c
commit 67cfa80836
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,6 +62,11 @@ def sparql_query(url, token, flow_id, query, user, collection, limit,
limit=limit, limit=limit,
batch_size=batch_size, 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") query_type = response.get("query-type", "select")
# ASK queries - just print and return # ASK queries - just print and return