mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Correctly handling 404s when in JSON views.
This commit is contained in:
parent
b690bb9de3
commit
9892670377
1 changed files with 3 additions and 1 deletions
|
@ -5,7 +5,7 @@ from django.utils.encoding import force_unicode
|
|||
from django.utils import simplejson as json
|
||||
from decimal import Decimal
|
||||
from django.core import serializers
|
||||
from django.http import HttpResponse, HttpResponseForbidden
|
||||
from django.http import HttpResponse, HttpResponseForbidden, Http404
|
||||
from django.core.mail import mail_admins
|
||||
from django.db.models.query import QuerySet
|
||||
import sys
|
||||
|
@ -96,6 +96,8 @@ def json_view(func):
|
|||
except KeyboardInterrupt:
|
||||
# Allow keyboard interrupts through for debugging.
|
||||
raise
|
||||
except Http404:
|
||||
raise Http404
|
||||
except Exception, e:
|
||||
# Mail the admins with the error
|
||||
exc_info = sys.exc_info()
|
||||
|
|
Loading…
Add table
Reference in a new issue