I need to control moving to trash some nodes by alias. I have created my custom EventHandler for "Document.BeforeMoveToTrash" event. I can set Cancel flag to true, for preventing this action.
Is there any way to set error message in event handlers and show it in backend infobubble? I want to show error with some additional error details.
Custom EventHandlers, how to set error message
Hello guys. First, excuse my english.
I need to control moving to trash some nodes by alias. I have created my custom EventHandler for "Document.BeforeMoveToTrash" event. I can set Cancel flag to true, for preventing this action.
Is there any way to set error message in event handlers and show it in backend infobubble? I want to show error with some additional error details.
Regards, Anton
P.S.: Error bubble in my understanding is
I would also like to know if this is possible!
I saw mention of this in another post (which I can't find again), to get your own message in the bubble, raise an exception:
This on its own appears to cancel the event (testing "Trashing" on MediaService), but I guess setting e.Cancel = true is advisable too?!
Hello Gordon. I found this solution, but it not work perfectly.
If I throw an exception in the event BeforeUnpublish, Umbraco falls (YSOD screen).
is working on a reply...