- Issue created by @ikam
- 🇩🇪Germany jurgenhaas Gottmadingen
That's not available yet, but we could write messages into tokens. However, there can be several messages, and it won't be simple to grab explicitly what you're looking for.
However, we are working on improved debugging techniques right now, if that's what you're looking for.
Or are you looking for messages to use them in conditions of your model to make certain decisions?
It would help if you could describe your use case for what you're trying to achieve.
Hi Jurgen - I'm looking for a way to retrieve error messages from the actions so that:
1. I'll know the ECA action has failed and I can display some appropriate error or warning message to the user.
Use Case:
User creates a piece of content and selects a Group for that content (i.e. add the content/node to a Group)
The ECA Action: Group Add Content failed due to Group security/permissions.
I would like to catch this failure and display a error message to the user informing the user that he has no permission to add content to the selected Group. Currently, the ECA Action: Group Add Content fails due to Group permissions but the user does not know the add content to Group failed.
2. Sometimes, depending on the error from the failed ECA action, I would like to determine what flow to execute next in the ECA model.
Use Case:
Same as above: User creates content and selects a Group for that content.
ECA Action: Group Add Content failed due to Group security/permissions.
If I can catch the failed ECA action, dependent on the error from the failed action, I would like to redirect the user to some other page.- 🇩🇪Germany jurgenhaas Gottmadingen
I think, that's the wrong approach. You should design your model in a way that you are in control of what's happening, and not try something, wait for potential errors, and then make other decisions.
For your examples above that means that you shouldn't provide access to the actions that will lead to any of the errors. Only then, the ECA model should be considered completed. So, if a user doesn't have the permission to add a certain entity to a group, don't allow them to even try.
With ECA you can use conditions to try beforehand and only display the links or buttons to the user when you've made sure that they are allowed to execute those.
When I load the create/edit content page, I already have an ECA model that will list only the groups for which the user has permissions to create/edit content. However, I'm afraid that between the time the create/edit content page is loaded and when the user actually saves the content to the selected group, group access permissions might have changed (this should rarely happen, if at all, but I'm still paranoid about it). I think I will mitigate that with ECA: Validate Form event to re-check and ensure the user still have access to the selected group when user clicks "Save" on the content. Thank you very much for your advice!