Skip to content

Commit

Permalink
Timeout messages more specific to source (re: #23)
Browse files Browse the repository at this point in the history
  • Loading branch information
shazow committed Dec 18, 2011
1 parent 2079c29 commit d67524e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions urllib3/connectionpool.py
Expand Up @@ -350,9 +350,15 @@ def urlopen(self, method, url, body=None, headers=None, retries=3,
# ``response.release_conn()`` is called (implicitly by
# ``response.read()``)

except (SocketTimeout, Empty), e:
# Timed out either by socket or queue
raise TimeoutError("Request timed out after %f seconds" % timeout)
except (Empty), e:
# Timed out by queue
raise TimeoutError("Request timed out. (pool_timeout=%s)" %
pool_timeout)

except (SocketTimeout), e:
# Timed out by socket
raise TimeoutError("Request timed out. (timeout=%s)" %
timeout)

except (BaseSSLError), e:
# SSL certificate error
Expand Down

0 comments on commit d67524e

Please sign in to comment.