KeepSafe/aiohttp — pull request #201 by jmcarp (2014-12-20 01:13:25+00:00)
Title: Raise original exception in `write_bytes`.

`ClientRequest#write_bytes` catches all exceptions and replaces them
with a generic `ClientRequestError`, which leads to tracebacks that can
be hard to interpret. This patch preserves the original exception and
traceback for simpler debugging.

Alternatively, if you want to raise the `ClientRequestError`, we could
pass the original exception to it so that it's still possible to figure out what
went wrong during debugging:
```python
reader.set_exception(
aiohttp.ClientRequestError(
'Can not write request body for %s' % self.url,
error=exc))
```