Skip to content

Commit

Permalink
Merge pull request #29 from Aeliot-Tm/make-exception-more-informative
Browse files Browse the repository at this point in the history
Make error of inline config parsing more informative
  • Loading branch information
Aeliot-Tm authored Jul 31, 2024
2 parents 0f392bb + 43911e8 commit 0e7340b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Service/TodoFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ public function create(CommentPart $commentPart): Todo

private function getInlineConfig(string $description): InlineConfigInterface
{
return $this->inlineConfigFactory->getInlineConfig($this->inlineConfigReader->getInlineConfig($description));
try {
$config = $this->inlineConfigReader->getInlineConfig($description);
} catch (\Throwable $exception) {
fwrite(STDERR, "[ERROR] Cannot parse inline config: {$exception->getMessage()} for $description \n");
$config = [];
}

return $this->inlineConfigFactory->getInlineConfig($config);
}
}

0 comments on commit 0e7340b

Please sign in to comment.