Skip to content

Commit

Permalink
precise triplestore error when sparql query fail
Browse files Browse the repository at this point in the history
  • Loading branch information
xgaia committed Jan 6, 2020
1 parent 92d6a18 commit f53e871
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions askomics/libaskomics/SparqlQueryLauncher.py
@@ -1,5 +1,4 @@
import time
import urllib
import traceback
import sys

Expand Down Expand Up @@ -304,9 +303,9 @@ def execute_query(self, query):
# self.log.debug(results)
return results

except urllib.error.URLError:
except Exception as e:
traceback.print_exc(file=sys.stdout)
raise urllib.error.URLError("Triplestore is not accessible")
raise type(e)("Triplestore error: {}".format(str(e))).with_traceback(sys.exc_info()[2])

def parse_results_old(self, json_results):
"""Parse result of sparql query
Expand Down

0 comments on commit f53e871

Please sign in to comment.