Diffusion - return 404 errors for bad URIs

Summary: Fixes T5646. Makes diffusion a much better user experience. Users now see a 404 exception page when they have a bad URI. Previously, they saw a developer-facing raw exception.

Test Plan: played around in diffusion a bunch. most of these changes were fairly mechanical at the end of the day.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T5646

Differential Revision: https://secure.phabricator.com/D11299
This commit is contained in:
Bob Trahan
2015-01-09 13:29:08 -08:00
parent 11a20079ef
commit a823654be0
45 changed files with 120 additions and 185 deletions

View File

@@ -6,20 +6,15 @@ final class DiffusionCommitBranchesController extends DiffusionController {
return true;
}
public function willProcessRequest(array $data) {
$data['user'] = $this->getRequest()->getUser();
$this->diffusionRequest = DiffusionRequest::newFromDictionary($data);
}
public function processRequest() {
$request = $this->getDiffusionRequest();
protected function processDiffusionRequest(AphrontRequest $request) {
$drequest = $this->getDiffusionRequest();
$branches = array();
try {
$branches = $this->callConduitWithDiffusionRequest(
'diffusion.branchquery',
array(
'contains' => $request->getCommit(),
'contains' => $drequest->getCommit(),
));
} catch (ConduitException $ex) {
if ($ex->getMessage() != 'ERR-UNSUPPORTED-VCS') {
@@ -34,7 +29,7 @@ final class DiffusionCommitBranchesController extends DiffusionController {
$branch_links[] = phutil_tag(
'a',
array(
'href' => $request->generateURI(
'href' => $drequest->generateURI(
array(
'action' => 'browse',
'branch' => $branch->getShortName(),