@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+8 -1
+8 -1
src/infrastructure/events/PhabricatorEventEngine.php
··· 8 8 public static function initialize() { 9 9 $listeners = PhabricatorEnv::getEnvConfig('events.listeners'); 10 10 foreach ($listeners as $listener) { 11 - id(new $listener())->register(); 11 + try { 12 + id(new $listener())->register(); 13 + } catch (Exception $ex) { 14 + // If the listener does not exist, or throws when registering, just 15 + // log it and continue. In particular, this is important to let you 16 + // run `bin/config` in order to remove an invalid listener. 17 + phlog($ex); 18 + } 12 19 } 13 20 14 21 // Register the DarkConosole event logger.