Skip to content

Log unhandled errors from event listeners#919

Merged
SebastiaanZ merged 2 commits into
masterfrom
bug/backend/911/log-listener-exceptions
May 5, 2020
Merged

Log unhandled errors from event listeners#919
SebastiaanZ merged 2 commits into
masterfrom
bug/backend/911/log-listener-exceptions

Conversation

@MarkKoz
Copy link
Copy Markdown
Contributor

@MarkKoz MarkKoz commented Apr 29, 2020

Fixes #911

By default, discord.py prints them to stderr. To better help detect such errors in production, they should instead be logged with an appropriate log level. Some sentry metadata has also been included.

@MarkKoz MarkKoz added t: bug Something isn't working a: backend Related to internal functionality and utilities (error_handler, logging, security, utils and core) p: 1 - high High Priority status: needs review labels Apr 29, 2020
@MarkKoz MarkKoz requested a review from a team as a code owner April 29, 2020 23:55
@MarkKoz MarkKoz requested review from SebastiaanZ, jb3 and jerbob and removed request for a team April 29, 2020 23:55
By default, discord.py prints them to stderr. To better help detect such
errors in production, they should instead be logged with an appropriate
log level. Some sentry metadata has also been included.

`on_error` doesn't work as a listener in a cog so it's been put in the
Bot subclass.

Fixes #911
@MarkKoz MarkKoz force-pushed the bug/backend/911/log-listener-exceptions branch from 6ae7021 to 2c48aa9 Compare April 29, 2020 23:57
Copy link
Copy Markdown
Contributor

@SebastiaanZ SebastiaanZ left a comment

Choose a reason for hiding this comment

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

Cool, this works.

@SebastiaanZ SebastiaanZ merged commit 007f771 into master May 5, 2020
@SebastiaanZ SebastiaanZ deleted the bug/backend/911/log-listener-exceptions branch May 5, 2020 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: backend Related to internal functionality and utilities (error_handler, logging, security, utils and core) p: 1 - high High Priority t: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use appropriate log level for exceptions from event listeners

3 participants