From 43911e861f5b86316fedb340a48f308f7d668b84 Mon Sep 17 00:00:00 2001 From: Anatoliy Melnikov <5785276@gmail.com> Date: Wed, 31 Jul 2024 16:21:05 +0300 Subject: [PATCH] Make error of inline config parsing more informative --- src/Service/TodoFactory.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Service/TodoFactory.php b/src/Service/TodoFactory.php index 97d2d2a..1886eee 100644 --- a/src/Service/TodoFactory.php +++ b/src/Service/TodoFactory.php @@ -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); } }