mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-18 10:41:08 +01:00
Fail more softly if we can't execute "ps"
Summary: If, e.g., $PATH is broken we may not be able to run "ps". We'll explode pretty hard, currently. Instead, just show a harsher warning. Test Plan: Changed "ps auxwww" to "psq", which doesn't exist on my system. Loaded page, got warning instead of explosion. Reviewers: nathanws, vrana, btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D2624
This commit is contained in:
parent
cb1177497e
commit
5fee8c50ee
1 changed files with 26 additions and 11 deletions
|
@ -46,11 +46,6 @@ abstract class PhabricatorRepositoryController extends PhabricatorController {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function renderDaemonNotice() {
|
protected function renderDaemonNotice() {
|
||||||
$daemon_running = $this->isPullDaemonRunningOnThisMachine();
|
|
||||||
if ($daemon_running) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$documentation = phutil_render_tag(
|
$documentation = phutil_render_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
|
@ -59,14 +54,34 @@ abstract class PhabricatorRepositoryController extends PhabricatorController {
|
||||||
),
|
),
|
||||||
'Diffusion User Guide');
|
'Diffusion User Guide');
|
||||||
|
|
||||||
|
$common =
|
||||||
|
"Without this daemon, Phabricator will not be able to import or update ".
|
||||||
|
"repositories. For instructions on starting the daemon, see ".
|
||||||
|
"<strong>{$documentation}</strong>.";
|
||||||
|
|
||||||
|
try {
|
||||||
|
$daemon_running = $this->isPullDaemonRunningOnThisMachine();
|
||||||
|
if ($daemon_running) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$title = "Repository Daemon Not Running";
|
||||||
|
$message =
|
||||||
|
"<p>The repository daemon is not running on this machine. ".
|
||||||
|
"{$common}</p>";
|
||||||
|
} catch (CommandException $ex) {
|
||||||
|
$title = "Unable To Verify Repository Daemon";
|
||||||
|
$message =
|
||||||
|
"<p>Unable to determine if the repository daemon is running on this ".
|
||||||
|
"machine. {$common}</p>".
|
||||||
|
"<p><strong>Exception:</strong> ".
|
||||||
|
phutil_escape_html($ex->getMessage()).
|
||||||
|
"</p>";
|
||||||
|
}
|
||||||
|
|
||||||
$view = new AphrontErrorView();
|
$view = new AphrontErrorView();
|
||||||
$view->setSeverity(AphrontErrorView::SEVERITY_WARNING);
|
$view->setSeverity(AphrontErrorView::SEVERITY_WARNING);
|
||||||
$view->setTitle('Repository Daemon Not Running');
|
$view->setTitle($title);
|
||||||
$view->appendChild(
|
$view->appendChild($message);
|
||||||
"<p>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 ".
|
|
||||||
"<strong>{$documentation}</strong>.</p>");
|
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue