Skip to content

Commit afe017b

Browse files
Added error handling for the main function genDiff().
1 parent 2d839c9 commit afe017b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/gendiff

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,8 @@ DOC;
4141

4242
$args = Docopt::handle($doc, array('version' => $about));
4343

44-
echo genDiff($args['<firstFile>'], $args['<secondFile>'], $args['--format']);
44+
try {
45+
echo genDiff($args['<firstFile>'], $args['<secondFile>'], $args['--format']);
46+
} catch (Exception $e) {
47+
echo "Error: {$e->getMessage()}";
48+
}

0 commit comments

Comments
 (0)