def _is_error_reportable(exc):
    if (isinstance(exc, NoReportError) or getattr(exc, '_disallow_report', False)):
        return False
    elif isinstance(exc, BadData):
        return False
    elif isinstance(exc, Forbidden):
        return (_need_json_response() and (session.user is not None))
    elif isinstance(exc, HTTPException):
        return _need_json_response()
    else:
        return True
def _is_error_reportable(exc):
    if (isinstance(exc, NoReportError) or getattr(exc, '_disallow_report', False)):
        return False
    elif isinstance(exc, BadData):
        return False
    elif isinstance(exc, Forbidden):
        return (_need_json_response() and (session.user is not None))
    elif isinstance(exc, HTTPException):
        return _need_json_response()
    else:
        return True