Skip to content

Commit f54a1a5

Browse files
Stop exceptions from breaking the watcher
1 parent 009399c commit f54a1a5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/PatternLab/Watcher.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@ private function updateSite($fileName,$message,$verbose = true) {
321321
Annotations::clear();
322322

323323
$g = new Generator();
324-
$g->generate($options);
324+
try {
325+
$g->generate($options);
326+
} catch (\Exception $e) {
327+
Console::writeWarning("Failed on update to ".$fileName);
328+
Console::writeWarning($e->getMessage());
329+
} catch (\Throwable $e) {
330+
Console::writeWarning("Failed on update to ".$fileName);
331+
Console::writeWarning($e->getMessage());
332+
}
325333

326334
}
327335

0 commit comments

Comments
 (0)