Should catch and wrap socket errors
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
piston-mini-client |
Fix Released
|
Medium
|
Anthony Lenton |
Bug Description
Hi,
I got the below traceback showing that when the other end refuses connections
you get a raw socket error back. I think catching and transforming it to be
an APIError would be good as a user of the library, as I can catch just the one
exception type.
Thanks,
James
File "/home/
e = self.assertRais
File "/home/
self.
File "/home/
mismatch = matcher.
File "/home/
mismatch = self.exception_
File "/home/
mismatch = matcher.
File "/home/
reraise(
File "/home/
result = matchee()
File "/home/
return self._callable_
File "/home/
api.
File "/home/
body = func(*args, **kwargs)
File "/home/
return self._post(
File "/home/
headers=
File "/home/
method=method, body=body, headers=headers)
File "/home/
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/home/
(response, content) = self._conn_
File "/home/
conn.connect()
File "/home/
raise socket.error, msg
error: [Errno 111] Connection refused
Related branches
- software-store-developers: Pending requested
-
Diff: 268 lines (+137/-8)6 files modifieddoc/envvars.rst (+3/-0)
doc/tuning.rst (+17/-0)
piston_mini_client/__init__.py (+31/-8)
piston_mini_client/consts.py (+1/-0)
piston_mini_client/failhandlers.py (+12/-0)
piston_mini_client/tests/test_timeout.py (+73/-0)
Changed in piston-mini-client: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in piston-mini-client: | |
status: | Confirmed → In Progress |
assignee: | nobody → Anthony Lenton (elachuni) |
Changed in piston-mini-client: | |
milestone: | none → 0.7.4 |
status: | In Progress → Fix Released |
How did you produce this error? When I tried calling a service that was down, I got an APIError.