1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Improve logging for syntax highlighting parsing

Summary:
add logging when syntax highlighting parsing throws exception.

Test Plan:
test when exception is thrown with non-php code. I couldn't
create a file to trigger an exception in running pygmentiza, so I
manually threw an exception to test it.

Reviewed By: tuomaspelkonen
Reviewers: tuomaspelkonen, epriestley
CC: aran, tuomaspelkonen, jungejason
Differential Revision: 350
This commit is contained in:
jungejason 2011-05-26 14:17:12 -07:00
parent 6c3b1feec8
commit 686ffafa21
2 changed files with 17 additions and 11 deletions

View file

@ -464,17 +464,22 @@ class DifferentialChangesetParser {
'new' => $new_future,
);
foreach (Futures($futures) as $key => $future) {
switch ($key) {
case 'old':
$this->oldRender = $this->processHighlightedSource(
$this->old,
$future->resolve());
break;
case 'new':
$this->newRender = $this->processHighlightedSource(
$this->new,
$future->resolve());
break;
try {
switch ($key) {
case 'old':
$this->oldRender = $this->processHighlightedSource(
$this->old,
$future->resolve());
break;
case 'new':
$this->newRender = $this->processHighlightedSource(
$this->new,
$future->resolve());
break;
}
} catch (Exception $ex) {
phlog($ex);
throw $ex;
}
}

View file

@ -18,6 +18,7 @@ phutil_require_module('phabricator', 'infrastructure/env');
phutil_require_module('phabricator', 'infrastructure/javelin/markup');
phutil_require_module('phabricator', 'storage/queryfx');
phutil_require_module('phutil', 'error');
phutil_require_module('phutil', 'filesystem');
phutil_require_module('phutil', 'filesystem/tempfile');
phutil_require_module('phutil', 'future');