Skip to content

Exception type mismatch in error handling #2345

@DorraJaouad

Description

@DorraJaouad

When anonymous users search through a public page share link, the search scans the entire Collective but attempts to filter unauthorized results using checkPageShareAccess(). However, this function throws OCSForbiddenException instead of the expected NotPermittedException, causing the exception to bypass the catch block and crash the API with HTTP 403 Forbidden.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions