Skip to content

Commit

Permalink
Explicitly catch potential crash on token file save
Browse files Browse the repository at this point in the history
  • Loading branch information
theseer committed Oct 5, 2014
1 parent 409a0e6 commit 39fdd5c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/collector/project/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,18 @@ private function saveSources() {
if (!file_exists($dir)) {
mkdir($dir, 0755, true);
}
$tokenDom->save($fname);
try {
$tokenDom->save($fname);
} catch (fDOMException $e) {
throw new ProjectException(
sprintf(
"Internal Error: Token xml file '%s' could not be saved.",
$fname
),
ProjectException::UnitCouldNotBeSaved,
$e
);
}
$this->source->setTokenFileReference($file, $relName);
}

Expand Down

0 comments on commit 39fdd5c

Please sign in to comment.