From 24c8b2f4aa0fbccbd2eaf8b8f6057705bdffe4cc Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 17 Sep 2021 06:42:06 -0300 Subject: [PATCH] Make error more specific Signed-off-by: Vitor Mattos --- lib/Service/BoardImportCommandService.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Service/BoardImportCommandService.php b/lib/Service/BoardImportCommandService.php index 3741f85cf..1f09853da 100644 --- a/lib/Service/BoardImportCommandService.php +++ b/lib/Service/BoardImportCommandService.php @@ -80,17 +80,18 @@ class BoardImportCommandService extends BoardImportService { $config = $this->getInput()->getOption('config'); if (is_string($config)) { if (!is_file($config)) { - throw new NotFoundException('Please inform a valid config json file'); + throw new NotFoundException('It\'s not a file.'); } $config = json_decode(file_get_contents($config)); if (!$config instanceof \stdClass) { - throw new NotFoundException('Please inform a valid config json file'); + throw new NotFoundException('Failed to parse JSON.'); } $this->setConfigInstance($config); } parent::validateConfig(); return; } catch (NotFoundException $e) { + $this->getOutput()->writeln('' . $e->getMessage() . ''); $helper = $this->getCommand()->getHelper('question'); $question = new Question( 'Please inform a valid config json file: ',