projects
/
htsworkflow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a805c82
)
Under some conditions urlerror doesn't have a code,
author
Diane Trout
<diane@caltech.edu>
Mon, 12 Jul 2010 19:01:31 +0000
(19:01 +0000)
committer
Diane Trout
<diane@caltech.edu>
Mon, 12 Jul 2010 19:01:31 +0000
(19:01 +0000)
so just report the raw error message in that case
htsworkflow/util/api.py
patch
|
blob
|
history
diff --git
a/htsworkflow/util/api.py
b/htsworkflow/util/api.py
index b5e2492fef78c456ead6c68df03010a85adb8625..316aa490fd0ceaa67a4ed3712ad336f9519b3bbe 100644
(file)
--- a/
htsworkflow/util/api.py
+++ b/
htsworkflow/util/api.py
@@
-83,11
+83,11
@@
def retrieve_info(url, apidata):
apipayload = urllib.urlencode(apidata)
web = urllib2.urlopen(url, apipayload)
except urllib2.URLError, e:
- if e.code == 404:
+ if
hasattr(e, 'code') and
e.code == 404:
logging.info("%s was not found" % (url,))
return None
else:
- errmsg = 'URLError: %
d %s' % (e.code, e.msg
)
+ errmsg = 'URLError: %
s' % (str(e)
)
raise IOError(errmsg)
contents = web.read()