From e90695fc8332982277acc4486d740e49fba10268 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 20 Jan 2015 14:14:44 -0800 Subject: [PATCH] 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 --- .../PhabricatorStorageManagementDumpWorkflow.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php index 2df475c027..deca8967de 100644 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php @@ -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; }