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"); } }