From e68ad377701a8798d4a7aaaccd680f017117df46 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Mon, 24 Mar 2025 09:53:07 +0300 Subject: [PATCH] Fixing main --- taskman.inc.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/taskman.inc.php b/taskman.inc.php index bef268a..eaafa0d 100644 --- a/taskman.inc.php +++ b/taskman.inc.php @@ -474,14 +474,11 @@ function main( $tasks = $hints; else { - printf("ERROR! Task %s not found\n", $tasks[0]); + $similars = ''; if($hints) - { - printf("Similar tasks:\n"); - foreach($hints as $hint) - printf(" %s\n", $hint); - } - exit(1); + $similars .= "\nSimilar tasks: " . implode(', ', $hints) . "."; + + throw new Exception("Task '{$tasks[0]}' not found. $similars"); } }