Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on scheme access #12

Closed
AlwxSin opened this issue Aug 24, 2018 · 2 comments · Fixed by #13
Closed

Error on scheme access #12

AlwxSin opened this issue Aug 24, 2018 · 2 comments · Fixed by #13

Comments

@AlwxSin
Copy link
Contributor

AlwxSin commented Aug 24, 2018

Hi, thanks for your library.

I encountered a bug when my ws connection closed. If my app tries to write into closed connection concurrent.futures._base.CancelledError raised. And this is ok.
But then aiohttp-sentry doesn't send an error to sentry because of

Traceback (most recent call last):
  ......
  File "/usr/local/lib/python3.6/site-packages/aiohttp_sentry/__init__.py", line 27, in middleware
    extra_data = await self.get_extra_data(request)
  File "/usr/local/lib/python3.6/site-packages/aiohttp_sentry/__init__.py", line 39, in get_extra_data
    'scheme': request.scheme,
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_request.py", line 290, in scheme
    if self.transport.get_extra_info('sslcontext'):
AttributeError: 'NoneType' object has no attribute 'get_extra_info'

I found the related issue but it seems closed.

Would you mind me create PR where I move request.scheme under if request.transport statement?

@underyx
Copy link
Owner

underyx commented Aug 24, 2018

Thank you so much for the investigative work, @AlwxSin! Indeed if this is how aiohttp works, we should move the scheme line as you described, like in this similar commit: d7080a8

A pull request would be appreciated. Thank you again!

@AlwxSin
Copy link
Contributor Author

AlwxSin commented Aug 24, 2018

Done.
Thanks for quick answer.

underyx pushed a commit that referenced this issue Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants