On Wed, Oct 15, 2008 at 3:58 PM, Jesse Young <[EMAIL PROTECTED]> wrote:
...
> I was thinking it would be useful to add a setting like
> EXCEPTION_NOTIFIER = 'path.to.custom.notifier' , where the default
> would look something like this:
>
> def mail_exception_to_admins(request, exc_info):
> from django.core.mail import mail_admins
> subject = 'Error (%s IP): %s' %
> ((request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS and
> 'internal' or 'EXTERNAL'), request.path)
> try:
> request_repr = repr(request)
> except:
> request_repr = "Request repr() unavailable"
> message = "%s\n\n%s" % (self._get_traceback(exc_info),
> request_repr)
> mail_admins(subject, message, fail_silently=True)
I like the idea, but not the addition of yet another setting. Maybe
an on_exception signal could be added which can do its own thing and
return False if the default action shouldn't be taken?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---