示例#1
0
def error_handler(e):
    code = getattr(e, 'code', 500)  # If 500, e == the exception.
    if code == 500:
        # Send email to all ADMINS.
        exception_name = e.__class__.__name__
        view_module = request.endpoint
        send_exception('{} exception in {}'.format(exception_name, view_module))
    return render_template('errors/{}.html'.format(code)), code
示例#2
0
def error_handler(e):
    code = getattr(e, 'code', 500)  # If 500, e == the exception.
    if code == 500:
        # Send email to all ADMINS.
        exception_name = e.__class__.__name__
        view_module = request.endpoint
        send_exception('{} exception in {}'.format(exception_name, view_module))
    return render_template('errors/{}.html'.format(code)), code
示例#3
0
def celery_error_handler(sender, exception, **_):
    exception_name = exception.__class__.__name__
    task_module = sender.name
    send_exception('{} exception in {}'.format(exception_name, task_module))
示例#4
0
def celery_error_handler(sender, exception, **_):
    exception_name = exception.__class__.__name__
    task_module = sender.name
    send_exception('{} exception in {}'.format(exception_name, task_module))