Skip to content

exception_to_status is incompatible with excluded_http_codes #3294

@ro0NL

Description

@ro0NL

API Platform version(s) affected: 2.5

any exception mapped in API Platform, e.g.

api_platform:
    exception_to_status:
        ApiPlatform\Core\Exception\InvalidArgumentException: !php/const Symfony\Component\HttpFoundation\Response::HTTP_BAD_REQUEST

cannot be excluded using e.g. excluded_http_codes: [400, ...]. The logs are still full of

request.CRITICAL: Uncaught PHP Exception ApiPlatform\Core\Exception\InvalidArgumentException

See also https://github.com/symfony/symfony/blob/e0f6cdb1c7040b5eb5d3281e5d77d088bdaf649e/src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php#L55

Ref symfony/recipes#698

Reported as a bug 👼

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