1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 04:20:55 +01:00

When storage is not initialized, write the error message to stderr instead of stdout

Summary:
We have to do some garbage nonsense to write database backups right now, see T6996.

When storage isn't initialized, we previously ended up with this message gzipped in a file and an empty error. Make the behavior slightly more tolerable.

Test Plan: Saw a meaningful error after trying to back up an uninitialized database.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11449
This commit is contained in:
epriestley 2015-01-20 14:14:44 -08:00
parent 20dbdd7c28
commit e90695fc83

View file

@ -11,17 +11,19 @@ final class PhabricatorStorageManagementDumpWorkflow
}
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
$api = $this->getAPI();
$patches = $this->getPatches();
$applied = $api->getAppliedPatches();
if ($applied === null) {
$namespace = $api->getNamespace();
echo phutil_console_wrap(
phutil_console_format(
"**No Storage**: There is no database storage initialized in this ".
"storage namespace ('{$namespace}'). Use '**storage upgrade**' to ".
"initialize storage.\n"));
$console->writeErr(
pht(
'**Storage Not Initialized**: There is no database storage '.
'initialized in this storage namespace ("%s"). Use '.
'**storage upgrade** to initialize storage.',
$namespace));
return 1;
}