mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Log and continue when trying to register an invalid event listener
Summary: We currently die if an event listener throws when registering (e.g., because it is misconfigured), but this prevents you from running `bin/config` to fix it, which is a bit silly. Test Plan: Created this revision with an invalid listener in config. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D6761
This commit is contained in:
parent
3d8eb641ea
commit
13d18376c1
1 changed files with 8 additions and 1 deletions
|
@ -8,7 +8,14 @@ final class PhabricatorEventEngine {
|
|||
public static function initialize() {
|
||||
$listeners = PhabricatorEnv::getEnvConfig('events.listeners');
|
||||
foreach ($listeners as $listener) {
|
||||
id(new $listener())->register();
|
||||
try {
|
||||
id(new $listener())->register();
|
||||
} catch (Exception $ex) {
|
||||
// If the listener does not exist, or throws when registering, just
|
||||
// log it and continue. In particular, this is important to let you
|
||||
// run `bin/config` in order to remove an invalid listener.
|
||||
phlog($ex);
|
||||
}
|
||||
}
|
||||
|
||||
// Register the DarkConosole event logger.
|
||||
|
|
Loading…
Reference in a new issue