Skip to content
Snippets Groups Projects
Commit 64555579 authored by alvaro's avatar alvaro
Browse files

Added output in case endpoint fails or SELECT query results can't be parsed.

parent 7d7cec30
No related branches found
No related tags found
No related merge requests found
......@@ -33,10 +33,23 @@ class Endpoint{
curl_setopt($c, CURLOPT_HTTPHEADER, $context);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$aux = curl_exec($c); // execute the curl command
if($conf['debug']){
if($aux == false){
trigger_error("Error executing SPARQL query: ".curl_error($c), E_USER_ERROR);
echo("Error executing SPARQL query: ".curl_error($c));
}
}
curl_close($c);
$this->params['output'] = $auxoutput;
if(preg_match("/select/i", $q)){
$r = json_decode($aux, true);
if($conf['debug']){
if($r == false){
trigger_error("Warning: Results from a SELECT sparql query couldn't get parsed", E_USER_WARNING);
echo("Warning: Results from a SELECT sparql query couldn't get parsed");
}
}
}
return $r;
}
if(preg_match("/describe/i", $q)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment