RDFLib/rdflib — Issue #157: parser.py raises unexpected Exception
Author: gjhiggins
Created: 2012-02-20 08:34:03+00:00
State: open

danielmr...@gmail.com, 2011-04-28T06:57:45.000Z

What steps will reproduce the problem?

import rdflib
rdflib.graph.Graph().parse(source="http://w3c.org/doesnotexist")

What is the expected output? What do you see instead?

HTTPError

What version of the product are you using? On what operating system?

Exception('"%s" while trying to open "%s"' % (e, self.url))

Instead of raising its own Exception why not take the Exception we get from urlopen()?

line 92:
- try:
- file = urlopen(req)
- except HTTPError, e:
- # TODO:
- raise Exception('"%s" while trying to open "%s"' % (e, self.url))
+
+ file = urlopen(req)
+

Comment 1 by gromgull
Fair point.

Comment 2 by gjhigg...@gmail.com
Fix applied in changeset 7fb275973ef2

Comment 3 by danielmr...@gmail.com
thanks!

Comment 4 by gromgull