Skip to content

fos_rest.exception.codes configuration bug? #1571

@tael

Description

@tael

Hi, I'm testing Exception Handling and stopped by a little problem belows.

I'm not sure this is a bug or NOT. But if not, I wish someone helps me! :D

Symfony\Component\HttpFoundation\Response::HTTP_* constant does not works.

from the manual ( http://symfony.com/doc/master/bundles/FOSRestBundle/4-exception-controller-support.html )

...
To map Exception classes to HTTP response status codes an exception map may be configured, where the keys match a fully qualified class name and the values are either an integer HTTP response status code or a string matching a class constant of the Symfony\Component\HttpFoundation\Response class:
...

This Configuration does works, well

fos_rest.exception.codes
            'Symfony\Component\Security\Core\Exception\AccessDeniedException': 403

But, This configuration does not works

fos_rest.exception.codes
            'Symfony\Component\Security\Core\Exception\AccessDeniedException': HTTP_FORBIDDEN

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