def METHOD_NAME(e):
    """Handle an exception and show the traceback to error page."""
    try:
        message = 'Please file an issue in GitHub: ' + \
                  traceback.format_exc()
        loggedin = 'username' in session
    except:
        message = (
            'Something went terribly wrong, '
            'and we failed to find the cause automatically. '
            'Please file an issue in GitHub.'
        )
        loggedin = False
    try:
        return render_template(
            'error.min.html',
            message=message,
            loggedin=loggedin
        ), 500
    except:
        return message, 500