handler404 should accept 'exception'

RESOLVED FIXED

Status

Socorro
Symbols
RESOLVED FIXED
10 days ago
10 days ago

People

(Reporter: peterbe, Assigned: peterbe)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

10 days ago
See https://irccloud.mozilla.com/pastebin/Wv5cWWsZ/

Basically, when you write your own, instead of django.views.defaults.page_not_found, you're supposed to accept an 'exception' second argument.
(Assignee)

Comment 1

10 days ago
Here it is on New Relic
https://rpm.newrelic.com/accounts/1402187/applications/62681492/filterable_errors#/show/e3077833-c94c-11e7-82e9-0242ac110005_4931_8394/stack_trace?top_facet=transactionUiName&primary_facet=error.class&barchart=barchart&_k=uhykbc
(Assignee)

Comment 2

10 days ago
I'm not able to reproduce it. Even with DEBUG=False and running with Gunicorn. 

But the way Django 1.11.7 handles it, they're very gentle around handler404 functions that raise a TypeError. 
https://github.com/django/django/blob/1.11.7/django/core/handlers/exception.py#L110-L116

So I suspect NewRelic incorrectly scoops up this exception when it's supposed to be swallowed.
Created attachment 8928186 [details] [review]
Link to GitHub pull-request: https://github.com/mozilla-services/tecken/pull/559

Comment 4

10 days ago
Commit pushed to master at https://github.com/mozilla-services/tecken

https://github.com/mozilla-services/tecken/commit/dfa656ca782d66a0de365995995f98dab611b664
fixes bug 1417086 - handler404 should accept 'exception' (#559)

Updated

10 days ago
Status: NEW → RESOLVED
Last Resolved: 10 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.