Page MenuHomePhabricator

Can I stop an operation from an eventlistener?
Closed, ObsoletePublic

Asked by aarwine on Aug 16 2013, 10:44 PM.
Tags
None
Referenced Files
None
Tokens
"Yellow Medal" token, awarded by wisutsak.jaisue.7.

Details

I've tied a custom event listener to PhabricatorEventType::TYPE_DIFFERENTIAL_WILLEDITREVISION

I want to know if I can stop the event from continuing from my listener.

Throwing exceptions makes the UI not continue, but does the operation without reloading the page. As does die and trigger_error (even if fatal)

I guess my alternative is to try to recreate $revision to be in a state it was prior to the edit...

Thanks,
-alex

Answers

davidreuss
Updated 3,845 Days Ago

I believe the event object has a stop() method, and you can check an event is stopped by calling ’isStopped()` on it.

New Answer

Answer

This question has been marked as closed, but you can still leave a new answer.