1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +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) { public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
$api = $this->getAPI(); $api = $this->getAPI();
$patches = $this->getPatches(); $patches = $this->getPatches();
$applied = $api->getAppliedPatches(); $applied = $api->getAppliedPatches();
if ($applied === null) { if ($applied === null) {
$namespace = $api->getNamespace(); $namespace = $api->getNamespace();
echo phutil_console_wrap( $console->writeErr(
phutil_console_format( pht(
"**No Storage**: There is no database storage initialized in this ". '**Storage Not Initialized**: There is no database storage '.
"storage namespace ('{$namespace}'). Use '**storage upgrade**' to ". 'initialized in this storage namespace ("%s"). Use '.
"initialize storage.\n")); '**storage upgrade** to initialize storage.',
$namespace));
return 1; return 1;
} }