Skip to content

Commit

Permalink
Check if error is an HTTPError before accesing the code attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
gilles-duboscq committed Feb 24, 2016
1 parent 7177c5d commit c58d94c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -3972,7 +3972,7 @@ 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)))
try:
Expand Down

0 comments on commit c58d94c

Please sign in to comment.