Skip to content

Commit

Permalink
Merge pull request graalvm#54 from gilles-duboscq/urlerror
Browse files Browse the repository at this point in the history
Check if error is an HTTPError before accesing the code attribute
  • Loading branch information
gilles-duboscq committed Feb 24, 2016
2 parents 7177c5d + d3e8d79 commit 6805b55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -3972,9 +3972,9 @@ def getSnapshot(self, groupId, artifactId, version):
try:
metadataFile = urllib2.urlopen(metadataUrl)
except urllib2.URLError as e:
if e.code == 404:
if isinstance(e, urllib2.HTTPError) and e.code == 404:
return None
abort('Error while retreiving snappshot for {}:{}:{}: {}'.format(groupId, artifactId, version, str(e)))
abort('Error while retrieving snapshot for {}:{}:{}: {}'.format(groupId, artifactId, version, str(e)))
try:
tree = etreeParse(metadataFile)
root = tree.getroot()
Expand Down

0 comments on commit 6805b55

Please sign in to comment.