1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Throw CommandException instead of Exception after git fetch failure in repository updates

Summary: Fixes T9966. In this unusual, difficult-to-reach case, we throw `Exception` (which has no censoring) instead of `CommandException` (which has censoring). Throw `CommandException` instead.

Test Plan:
  - Hacked up a bunch of stuff in order to hit this: disabled origin validation, origin correction, and pointed repository at a bad domain.
  - Verified message is now censored correctly.

{F1022217}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9966

Differential Revision: https://secure.phabricator.com/D14745
This commit is contained in:
epriestley 2015-12-11 16:48:22 -08:00
parent 4ec6990ca7
commit 7b99735946

View file

@ -334,12 +334,12 @@ final class PhabricatorRepositoryPullEngine
$remote_uri); $remote_uri);
} }
} else if ($err) { } else if ($err) {
throw new Exception( throw new CommandException(
pht( pht('Failed to fetch changes!'),
"git fetch failed with error #%d:\nstdout:%s\n\nstderr:%s\n", $future->getCommand(),
$err, $err,
$stdout, $stdout,
$stderr)); $stderr);
} else { } else {
$retry = false; $retry = false;
} }