1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: bring back panic(err.msg) -> panic(err) (#9022)

This commit is contained in:
spaceface
2021-03-01 00:18:14 +01:00
committed by GitHub
parent ce115dcbe0
commit b712af56fd
110 changed files with 383 additions and 387 deletions

View File

@@ -64,10 +64,10 @@ pub fn color_compare_strings(diff_cmd string, expected string, found string) str
ctime := time.sys_mono_now()
e_file := os.join_path(cdir, '${ctime}.expected.txt')
f_file := os.join_path(cdir, '${ctime}.found.txt')
os.write_file(e_file, expected) or { panic(err.msg) }
os.write_file(f_file, found) or { panic(err.msg) }
os.write_file(e_file, expected) or { panic(err) }
os.write_file(f_file, found) or { panic(err) }
res := color_compare_files(diff_cmd, e_file, f_file)
os.rm(e_file) or { panic(err.msg) }
os.rm(f_file) or { panic(err.msg) }
os.rm(e_file) or { panic(err) }
os.rm(f_file) or { panic(err) }
return res
}

View File

@@ -214,7 +214,7 @@ pub fn launch_tool(is_verbose bool, tool_name string, args []string) {
if should_compile {
emodules := util.external_module_dependencies_for_tool[tool_name]
for emodule in emodules {
check_module_is_installed(emodule, is_verbose) or { panic(err.msg) }
check_module_is_installed(emodule, is_verbose) or { panic(err) }
}
mut compilation_command := '"$vexe" '
if tool_name in ['vself', 'vup', 'vdoctor', 'vsymlink'] {
@@ -229,7 +229,7 @@ pub fn launch_tool(is_verbose bool, tool_name string, args []string) {
if is_verbose {
println('Compiling $tool_name with: "$compilation_command"')
}
tool_compilation := os.exec(compilation_command) or { panic(err.msg) }
tool_compilation := os.exec(compilation_command) or { panic(err) }
if tool_compilation.exit_code != 0 {
eprintln('cannot compile `$tool_source`: \n$tool_compilation.output')
exit(1)
@@ -462,7 +462,7 @@ pub fn ensure_modules_for_all_tools_are_installed(is_verbose bool) {
eprintln('Installing modules for tool: $tool_name ...')
}
for emodule in tool_modules {
check_module_is_installed(emodule, is_verbose) or { panic(err.msg) }
check_module_is_installed(emodule, is_verbose) or { panic(err) }
}
}
}
@@ -535,7 +535,7 @@ pub fn get_vtmp_folder() string {
}
vtmp = os.join_path(os.temp_dir(), 'v')
if !os.exists(vtmp) || !os.is_dir(vtmp) {
os.mkdir_all(vtmp) or { panic(err.msg) }
os.mkdir_all(vtmp) or { panic(err) }
}
os.setenv('VTMP', vtmp, true)
return vtmp