Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception throw on missing resource is now configurable. #33

Open
wants to merge 1 commit into
base: master
from

Conversation

@PedroTroller
Copy link
Member

commented Oct 26, 2016

No description provided.

@PedroTroller PedroTroller added the ToDo label Oct 26, 2016

@PedroTroller PedroTroller force-pushed the feature/configurable-not-found-exception branch from a8caf31 to cf910b9 Oct 26, 2016

@PedroTroller PedroTroller added Ready to review and removed ToDo labels Oct 26, 2016

service: app.building.repository
method: findByCountryAndCityAndActivity
arguments: [$countryId, $citySlug, "School"]
on-missing: 401

This comment has been minimized.

Copy link
@AntoineLelaisant

AntoineLelaisant Oct 26, 2016

At least, I would have add a "throw" key:

_resources:
    buildings:
        service: app.building.repository
        method: findByCountryAndCityAndActivity
        arguments: [$countryId, $citySlug, "School"]
        on-missing:
            throw: 401

That would allow us to add more functionalities when a resource is missing. For instance:

_resources:
    buildings:
        service: app.building.repository
        method: findByCountryAndCityAndActivity
        arguments: [$countryId, $citySlug, "School"]
        on-missing:
            redirect: 
                route: 'app.homepage'
                parameters: 
                    - 'some_params'

This comment has been minimized.

Copy link
@Einenlum

Einenlum Nov 3, 2016

Oh, clever! 👍

This comment has been minimized.

Copy link
@Einenlum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.