# Empty Exception Handler - ID: python-empty-except-block - Severity: MEDIUM - CWE: CWE-391 (CWE-391) - Languages: Python - Frameworks: django, flask, fastapi ## Description Detects empty except blocks that silently swallow exceptions. This can hide security-critical errors, authentication failures, or data validation issues. ## Remediation Log exceptions or handle them explicitly instead of using empty except blocks. ```python import logging logger = logging.getLogger(__name__) try: risky_operation() except Exception as e: logger.error(f"Operation failed: {e}", exc_info=True) return {'error': 'Operation failed'}, 500 ``` Learn more: https://shoulder.dev/learn/python/cwe-391/empty-except ## Documentation [object Object] ## Related Rules - **Empty Error Handling** [LOW]: - **Unhandled Promise Rejection** [HIGH]: