8000 Don't report WebSocket close connection errors by seanh · Pull Request #5497 · hypothesis/h · GitHub
[go: up one dir, main page]

Skip to content

Don't report WebSocket close connection errors #5497

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

Merged

Conversation

seanh
Copy link
Member
@seanh seanh commented Jan 16, 2019

Fixes #5496

@seanh seanh force-pushed the dont-send-ws4py-connection-termination-errors-to-sentry branch from 8fe21e7 to 5bf50e3 Compare January 16, 2019 18:48
@seanh seanh removed the WIP label Jan 16, 2019
@@ -7,6 +7,22 @@
import sentry_sdk.integrations.pyramid


def _before_send(event, hint):
logger = event.get("logger")
message = event.get("logentry", {}).get("message")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some defensive programming here because the event dict doesn't always contain "logger" and "logentry", it only contains them when the event is a logged error message, not when it's a raised exception. For exceptions logger and message will both be None.

@seanh seanh added the Sentry 💥 Issue created or linked to Sentry crash report label Jan 16, 2019
Copy link
Contributor
@dmfine dmfine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@seanh seanh merged commit 8c05ed1 into master Jan 16, 2019
@seanh seanh deleted the dont-send-ws4py-connection-termination-errors-to-sentry branch January 16, 2019 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sentry 💥 Issue created or linked to Sentry crash report
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0