diff options
author | Dan McGee <dan@archlinux.org> | 2014-06-10 21:04:39 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2014-06-10 21:04:39 -0500 |
commit | c51ff717d9bdfed86e604af1cbbaf2870176f031 (patch) | |
tree | f80473cfd5599a542942ecfd21de30c2fc400056 | |
parent | d3a36903d0fb738e3a916169fb109072efbff721 (diff) |
Use last element in args tuple as error message
When things blow up in low-level C code, the tuple is sometimes of
length one, such as when it contains this error message:
_ssl.c:495: The handshake operation timed out
Just use the last element of the tuple, which works for all of the
cases.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | mirrors/management/commands/mirrorcheck.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mirrors/management/commands/mirrorcheck.py b/mirrors/management/commands/mirrorcheck.py index e48aa42e..d2a27bee 100644 --- a/mirrors/management/commands/mirrorcheck.py +++ b/mirrors/management/commands/mirrorcheck.py @@ -139,7 +139,7 @@ def check_mirror_url(mirror_url, location, timeout): if isinstance(e.reason, socket.timeout): log.error = "Connection timed out." elif isinstance(e.reason, socket.error): - log.error = e.reason.args[1] + log.error = e.reason.args[-1] logger.debug("failed: %s, %s", url, log.error) except HTTPException: # e.g., BadStatusLine |