diff --git a/src/applications/repository/controller/PhabricatorRepositoryController.php b/src/applications/repository/controller/PhabricatorRepositoryController.php index 2a96aeaa5d..dcb62685f9 100644 --- a/src/applications/repository/controller/PhabricatorRepositoryController.php +++ b/src/applications/repository/controller/PhabricatorRepositoryController.php @@ -46,11 +46,6 @@ abstract class PhabricatorRepositoryController extends PhabricatorController { } protected function renderDaemonNotice() { - $daemon_running = $this->isPullDaemonRunningOnThisMachine(); - if ($daemon_running) { - return null; - } - $documentation = phutil_render_tag( 'a', array( @@ -59,14 +54,34 @@ abstract class PhabricatorRepositoryController extends PhabricatorController { ), 'Diffusion User Guide'); + $common = + "Without this daemon, Phabricator will not be able to import or update ". + "repositories. For instructions on starting the daemon, see ". + "{$documentation}."; + + try { + $daemon_running = $this->isPullDaemonRunningOnThisMachine(); + if ($daemon_running) { + return null; + } + $title = "Repository Daemon Not Running"; + $message = + "
The repository daemon is not running on this machine. ". + "{$common}
"; + } catch (CommandException $ex) { + $title = "Unable To Verify Repository Daemon"; + $message = + "Unable to determine if the repository daemon is running on this ". + "machine. {$common}
". + "Exception: ". + phutil_escape_html($ex->getMessage()). + "
"; + } + $view = new AphrontErrorView(); $view->setSeverity(AphrontErrorView::SEVERITY_WARNING); - $view->setTitle('Repository Daemon Not Running'); - $view->appendChild( - "The repository daemon is not running on this machine. Without this ". - "daemon, Phabricator will not be able to import or update repositories. ". - "For instructions on starting the daemon, see ". - "{$documentation}.
"); + $view->setTitle($title); + $view->appendChild($message); return $view; }