Skip to content

bug(audit): broad exception swallowing hides real errors #312

Description

@thejoeejoee

Description

In django/apps/api/views/audit.py at line 41, a broad except Exception catches all exceptions (including programming errors, database failures, etc.) and returns a generic response.

This silently hides real bugs — any error in the audit query path is swallowed and the client receives a normal-looking response.

Severity

Medium — silent error masking makes debugging difficult and hides real issues.

Location

django/apps/api/views/audit.py:41

Fix

Catch only specific expected exceptions (e.g., ContentType.DoesNotExist, ValueError), and let unexpected exceptions propagate to the error handler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingimpact: mediumMedium impact — correctness or performance issuepythonPull requests that update Python code

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions