1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 23:32:40 +01:00

Make ./bin/diviner generate more fault tolerant

Summary: Allow `./bin/diviner generate` to continue even if there is an exception throw processing an atom. This allows Diviner documentation to be generated for PHP source code that cannot be parsed with XHPAST.

Test Plan: Ran `./bin/diviner generate` on a PHP repository which previously throw an `XHPASTSyntaxErrorException`.

Reviewers: btrahan, epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D10803
This commit is contained in:
Joshua Spence 2014-11-07 11:41:17 +11:00
parent 97f05d6ab8
commit bcd78716df

View file

@ -334,6 +334,7 @@ final class DivinerGenerateWorkflow extends DivinerWorkflow {
$bar = id(new PhutilConsoleProgressBar()) $bar = id(new PhutilConsoleProgressBar())
->setTotal(count($futures)); ->setTotal(count($futures));
foreach (Futures($futures)->limit(4) as $key => $future) { foreach (Futures($futures)->limit(4) as $key => $future) {
try {
$atoms = $future->resolveJSON(); $atoms = $future->resolveJSON();
foreach ($atoms as $atom) { foreach ($atoms as $atom) {
@ -343,6 +344,9 @@ final class DivinerGenerateWorkflow extends DivinerWorkflow {
} }
$atom_cache->addAtom($atom); $atom_cache->addAtom($atom);
} }
} catch (Exception $e) {
phlog($e);
}
$bar->update(1); $bar->update(1);
} }