[Django] #32261: Log exceptions handled in Signal.send_robust()

14 views
Skip to first unread message

Django

unread,
Dec 11, 2020, 3:26:11 PM12/11/20
to django-...@googlegroups.com
#32261: Log exceptions handled in Signal.send_robust()
-------------------------------------------------+------------------------
Reporter: Adam (Chainz) Johnson | Owner: nobody
Type: New feature | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------------+------------------------
As pointed out by [https://twitter.com/be_haki/status/1335921247306264579
Haki Benita on Twitter], by default `Signal.send_robust()` doesn't have
any log messages for exceptions raised in receivers. Since Django logs
exceptions in other similar situations, such as missing template
variables, I think it would be worth adding a `logger.exception()` call in
the `except` clause of `send_robust()` . Users would then see such
exceptions in their error handling tools, e.g. Sentry, and be able to
figure out what action to take from there. Ultimately any *expected*
exception should be caught with a `try` in the receiver function.

--
Ticket URL: <https://code.djangoproject.com/ticket/32261>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 11, 2020, 4:51:39 PM12/11/20
to django-...@googlegroups.com
#32261: Log exceptions handled in Signal.send_robust()
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: nobody
Johnson |

Type: New feature | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/32261#comment:1>

Django

unread,
Dec 12, 2020, 1:45:33 AM12/12/20
to django-...@googlegroups.com
#32261: Log exceptions handled in Signal.send_robust()
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Ayush
Johnson | Bansal
Type: New feature | Status: assigned

Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ayush Bansal):

* owner: nobody => Ayush Bansal
* status: new => assigned


Comment:

I would like to work on this issue.
PS. i am new to this django. so any advice would be appreciated

--
Ticket URL: <https://code.djangoproject.com/ticket/32261#comment:2>

Django

unread,
Dec 12, 2020, 10:53:27 AM12/12/20
to django-...@googlegroups.com
#32261: Log exceptions handled in Signal.send_robust()
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Ayush
Johnson | Bansal
Type: New feature | Status: assigned
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ayush Bansal):

* has_patch: 0 => 1


Comment:

https://github.com/django/django/pull/13768 PR

--
Ticket URL: <https://code.djangoproject.com/ticket/32261#comment:3>

Django

unread,
Dec 14, 2020, 3:31:50 AM12/14/20
to django-...@googlegroups.com
#32261: Log exceptions handled in Signal.send_robust()
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Ayush
Johnson | Bansal
Type: New feature | Status: assigned
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32261#comment:4>

Django

unread,
Dec 15, 2020, 3:58:11 AM12/15/20
to django-...@googlegroups.com
#32261: Log exceptions handled in Signal.send_robust()
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Ayush
Johnson | Bansal
Type: New feature | Status: assigned
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/32261#comment:5>

Django

unread,
Dec 15, 2020, 5:22:28 AM12/15/20
to django-...@googlegroups.com
#32261: Log exceptions handled in Signal.send_robust()
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Ayush
Johnson | Bansal
Type: New feature | Status: closed

Component: Core (Other) | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b960e4ed722a04a9db0d35293f76e253eedf9126" b960e4e]:
{{{
#!CommitTicketReference repository=""
revision="b960e4ed722a04a9db0d35293f76e253eedf9126"
Fixed #32261 -- Added error logging to Signal.send_robust().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32261#comment:6>

Reply all
Reply to author
Forward
0 new messages