theelous3 / asks

Async requests-like httplib for python.
MIT License
508 stars 63 forks source link

Re-raise exceptions. #76

Closed miracle2k closed 6 years ago

miracle2k commented 6 years ago

W/o this, I sometimes see the message NameError: r is not defined, because it just falls through.

theelous3 commented 6 years ago

https://github.com/theelous3/asks/blob/master/asks/sessions.py#L242

I think this will not fix any r not def'd exceptions you are seeing. See https://github.com/theelous3/asks/issues/74#issuecomment-395608431 for possible reasons. Issue there is a diff scope.

miracle2k commented 6 years ago

I am pretty sure what was happening in my case is that

sock = await self._grab_connection(url)

caused an exception (I think it was "hostname not found") which then means that sock is not defined, which means that if sock does not pass.

theelous3 commented 6 years ago

That makes perfect sense, and nice catch.