From ce3681ee8f319f94973fd373b16719dfba19d3b2 Mon Sep 17 00:00:00 2001 From: zakuro Date: Sun, 20 Jun 2021 19:12:08 +0900 Subject: [PATCH] v ast: eprintln and exit instead of panic on invalid file errors (#10526) --- cmd/tools/vast/vast.v | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/tools/vast/vast.v b/cmd/tools/vast/vast.v index b67b4328b0..94dcad1ec6 100644 --- a/cmd/tools/vast/vast.v +++ b/cmd/tools/vast/vast.v @@ -74,10 +74,12 @@ fn get_abs_path(path string) string { // check file is v file and exists fn check_file(file string) { if os.file_ext(file) !in ['.v', '.vv', '.vsh'] { - panic('the file `$file` must be a v file or vsh file') + eprintln('the file `$file` must be a v file or vsh file') + exit(1) } if !os.exists(file) { - panic('the v file `$file` does not exist') + eprintln('the v file `$file` does not exist') + exit(1) } }