}
-def get_error(msg):
- if isinstance(msg, str):
- return msg
+def get_error(e):
+ if isinstance(e, str):
+ return e
else:
s = []
- for i in msg:
+ for i in e:
s.append("'%s'" % str(i).replace('\n', "\\n"))
return "(%s)" % ' '.join(s)
except RedirectException, e:
return None, e.errcode, e.newurl, None, None
- except IOError, msg:
- if (msg[0] == "http error") and (msg[1] == -1):
+ except IOError, e:
+ if (e[0] == "http error") and (e[1] == -1):
error = None
bookmark.no_error = "The server did not return any header - it is not an error, actually"
self.log(' no headers: %s' % bookmark.no_error)
else:
- error = get_error(msg)
+ error = get_error(e)
self.log(' Error: %s' % error)
return error, None, None, None, None