diff service/reasoning/rdflibtrig.py @ 118:7179284779fd

errors and logging in reasoning Ignore-this: 112b2985e0f5fd2a36abded52a5292b6
author drewp@bigasterisk.com
date Sun, 22 Sep 2013 00:31:39 -0700
parents 4cd065b97fa1
children 745eff67ad40
line wrap: on
line diff
--- a/service/reasoning/rdflibtrig.py	Sun Sep 22 00:30:20 2013 -0700
+++ b/service/reasoning/rdflibtrig.py	Sun Sep 22 00:31:39 2013 -0700
@@ -26,7 +26,10 @@
         
 def addTrig(graph, url):
     t1 = time.time()
-    trig = restkit.request(url).body_string()
+    response = restkit.request(url)
+    if response.status_int != 200:
+        raise ValueError("status %s from %s" % (response.status, url))
+    trig = response.body_string()
     fetchTime = time.time() - t1
     graph.addN(parseTrig(trig))
     return fetchTime