mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v ast: eprintln and exit instead of panic on invalid file errors (#10526)
This commit is contained in:
parent
44d0305ca9
commit
ce3681ee8f
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user