-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Catch event stop during create/update #2385
Conversation
👍 |
@pjedrzejewski @stloyd is it OK for you ? |
As said before, looks good. |
wait for @pjedrzejewski feedback ? |
ping @pjedrzejewski |
Yah ping @pjedrzejewski |
@pjedrzejewski ping... again... |
Does not sound right to me, 500 when you stop the saving/deletion? It's not always case of an error, no? |
@pjedrzejewski ok, how can i manage it in a better way ? |
65171fa
to
d8ed93f
Compare
@pjedrzejewski I made the errorCode configurable by setter and stop method on ResourceEvent object. |
@pjedrzejewski Better or not ? Can be merge soon ? |
I'm not sure I like the fact that domain manager returns resource event ... It sounds a bit hacky to me. However, I have no idea how to make it better. What is your current usecase? (I see you need it fast J) |
I need it to check if customer has enough credit to do the operation during the creation process inside an event and stop event if not enough credit. All the operation are done with REST API process. Do you understand the usecase ? |
@pjedrzejewski what do you think ? we really need a functionallity like this ! |
OK, I understand, but don't you think it is weird that in case of API call returing ResourceEvent means errors, while in case of normal call, it redirects to index? |
In API call, the fact we get a ResourceEvent will allow to throw the exception. In WEB call, if an error occur, the browser will be redirected to the index with a flash message. So in the two cases, we are informed that something went wrong. Maybe in WEB call we need to redirect to current page ? Do you have a better solution ? |
Catch event stop during create/update
Now I get it! :) Thanks Jeremy! This needs to be reworked, but I will include this behavior! |
OK thanks, take me in touch if you want some help |
Catch event stop during create/update
Catch event stop during create/update
My bad for the PR on splitted repo ...
Related to #2022 and Sylius/SyliusResourceBundle#75
Is it OK ?