Detect if a commit *really* doesn't exist and 4oh4 from Diffusion commit view

Summary: rather than showing an erroneous "we still parsing" message.

Test Plan: for each version control system, typed in a garbage URL and got a 4oh4. (note this actually fails for SVN -- see comment about how my code fails atm -- and DiffusionGitRequest seems to pick off this error in advance and returns an AphrontUsageException.)

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1624

Differential Revision: https://secure.phabricator.com/D3201
This commit is contained in:
Bob Trahan
2012-08-09 09:27:45 -07:00
parent d32926e5f7
commit b86d995b40
6 changed files with 150 additions and 4 deletions

View File

@@ -50,13 +50,16 @@ final class DiffusionCommitController extends DiffusionController {
$commit = $drequest->loadCommit();
if (!$commit) {
// TODO -- T1624 -- detect if this has actually not been parsed yet
// and show this UI if so, else 404
$query = DiffusionExistsQuery::newFromDiffusionRequest($drequest);
$exists = $query->loadExistentialData();
if (!$exists) {
return new Aphront404Response();
}
return $this->buildStandardPageResponse(
id(new AphrontErrorView())
->setTitle('Error displaying commit.')
->appendChild('Failed to load the commit. The commit has not been '.
'parsed yet.'),
->appendChild('Failed to load the commit because the commit has not '.
'been parsed yet.'),
array('title' => 'Commit Still Parsing')
);
}