@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Give "bin/config" a friendlier error message if "local.json" is not writable

Summary: Ref T13403. We currently emit a useful error message, but it's not tailored and has a stack trace. Since this is a relatively routine error and on the first-time-setup path, tailor it so it's a bit nicer.

Test Plan:
- Ran `bin/config set ...` with an unwritable "local.json".
- Ran `bin/config set ...` normally.

Maniphest Tasks: T13403

Differential Revision: https://secure.phabricator.com/D20779

+13 -2
+13 -2
src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
··· 140 140 'Wrote configuration key "%s" to database storage.', 141 141 $key); 142 142 } else { 143 - $config_source = id(new PhabricatorConfigLocalSource()) 144 - ->setKeys(array($key => $value)); 143 + $config_source = new PhabricatorConfigLocalSource(); 145 144 146 145 $local_path = $config_source->getReadablePath(); 146 + 147 + try { 148 + Filesystem::assertWritable($local_path); 149 + } catch (FilesystemException $ex) { 150 + throw new PhutilArgumentUsageException( 151 + pht( 152 + 'Local path "%s" is not writable. This file must be writable '. 153 + 'so that "bin/config" can store configuration.', 154 + Filesystem::readablePath($local_path))); 155 + } 156 + 157 + $config_source->setKeys(array($key => $value)); 147 158 148 159 $write_message = pht( 149 160 'Wrote configuration key "%s" to local storage (in file "%s").',