Skip to content

Exceptions mapped in config aren't caught anymore, 500 is thrown instead #2369

@SebastienTediber

Description

@SebastienTediber

Hello,

Since we updated to 3.x.x, the exceptions I mapped in my config files aren't caught and a 500 is thrown instead.

Here is my configuration :

fos_rest:
    exception:
        enabled: true
        messages:
            Symfony\Component\HttpKernel\Exception\HttpException: true
            InvalidArgumentException: true
            Sylius\Component\Resource\Exception\UnexpectedTypeException: true
            PHPUnit\Framework\Warning: true

    view:
        formats:
            json: true
            xml:  true
        empty_content: 204
    format_listener:
        rules:
            - { path: '^/shop-api', priorities: ['json'], fallback_format: json, prefer_extension: true }
            - { path: '^/api/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true }
            - { path: '^/cron/.*', priorities: ['json'], fallback_format: json, prefer_extension: false }
            - { path: '^/', stop: true }

I have been trying with InvalidArgumentException thrown.

I have been changing the configuration a few times, adding the code to my exception too, it still does not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions