mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-18 18:51:12 +01:00
Fail feed story renders individually, instead of in aggregate
Summary: When we fail to render a feed story because something is broken, just break that story, not the entire feed. Test Plan: {F125898} Reviewers: btrahan, chad Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D8488
This commit is contained in:
parent
a0f534b87c
commit
966eb2ae26
1 changed files with 15 additions and 2 deletions
|
@ -57,8 +57,21 @@ final class PhabricatorFeedBuilder {
|
|||
$null_view->appendChild($header);
|
||||
}
|
||||
|
||||
$view = $story->renderView();
|
||||
$view->setUser($user);
|
||||
try {
|
||||
$view = $story->renderView();
|
||||
$view->setUser($user);
|
||||
$view = $view->render();
|
||||
} catch (Exception $ex) {
|
||||
// If rendering failed for any reason, don't fail the entire feed,
|
||||
// just this one story.
|
||||
$view = id(new PHUIFeedStoryView())
|
||||
->setUser($user)
|
||||
->setChronologicalKey($story->getChronologicalKey())
|
||||
->setEpoch($story->getEpoch())
|
||||
->setTitle(
|
||||
pht('Feed Story Failed to Render (%s)', get_class($story)))
|
||||
->appendChild(pht('%s: %s', get_class($ex), $ex->getMessage()));
|
||||
}
|
||||
|
||||
$null_view->appendChild($view);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue