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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user