Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionServeController.php
| Show First 20 Lines • Show All 391 Lines • ▼ Show 20 Lines | if ($vcs_type != $req_type) { | ||||
| 500, | 500, | ||||
| pht('Unknown request type.')); | pht('Unknown request type.')); | ||||
| break; | break; | ||||
| } | } | ||||
| } else { | } else { | ||||
| switch ($vcs_type) { | switch ($vcs_type) { | ||||
| case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: | case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: | ||||
| case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: | case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: | ||||
| $caught = null; | |||||
| try { | |||||
| $result = $this->serveVCSRequest($repository, $viewer); | $result = $this->serveVCSRequest($repository, $viewer); | ||||
| } catch (Exception $ex) { | |||||
| $caught = $ex; | |||||
| } catch (Throwable $ex) { | |||||
| $caught = $ex; | |||||
| } | |||||
| if ($caught) { | |||||
| // We never expect an uncaught exception here, so dump it to the | |||||
| // log. All routine errors should have been converted into Response | |||||
| // objects by a lower layer. | |||||
| phlog($caught); | |||||
| $result = new PhabricatorVCSResponse( | |||||
| 500, | |||||
| phutil_string_cast($caught->getMessage())); | |||||
| } | |||||
| break; | break; | ||||
| case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: | case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: | ||||
| $result = new PhabricatorVCSResponse( | $result = new PhabricatorVCSResponse( | ||||
| 500, | 500, | ||||
| pht( | pht( | ||||
| 'Phabricator does not support HTTP access to Subversion '. | 'Phabricator does not support HTTP access to Subversion '. | ||||
| 'repositories.')); | 'repositories.')); | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 877 Lines • Show Last 20 Lines | |||||