Page MenuHomePhabricator

D21525.id51232.diff
No OneTemporary

D21525.id51232.diff

diff --git a/src/applications/diffusion/controller/DiffusionServeController.php b/src/applications/diffusion/controller/DiffusionServeController.php
--- a/src/applications/diffusion/controller/DiffusionServeController.php
+++ b/src/applications/diffusion/controller/DiffusionServeController.php
@@ -397,7 +397,25 @@
switch ($vcs_type) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
- $result = $this->serveVCSRequest($repository, $viewer);
+ $caught = null;
+ try {
+ $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;
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
$result = new PhabricatorVCSResponse(

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 29, 7:17 PM (6 d, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225349
Default Alt Text
D21525.id51232.diff (1 KB)

Event Timeline