From f7f358f10049783a0fc20a43597a19a4042e6d59 Mon Sep 17 00:00:00 2001 From: syheliel Date: Fri, 16 Feb 2024 11:49:59 +0800 Subject: [PATCH 1/2] refine input file missing msg --- src/bin/lpython.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/lpython.cpp b/src/bin/lpython.cpp index 6f0fc85b24..3a0fabb28b 100644 --- a/src/bin/lpython.cpp +++ b/src/bin/lpython.cpp @@ -1735,7 +1735,8 @@ int main(int argc, char *argv[]) // the first: std::string arg_file = arg_files[0]; if (CLI::NonexistentPath(arg_file).empty()){ - throw LCompilers::LCompilersException("No such file or directory: " + arg_file); + std::cerr << "Your input file doesn't exist. file name is: " << arg_file << std::endl; + return 1; } std::string outfile; From 602285c1a44ee8972e42b1d09c8fdfd4f1750c9a Mon Sep 17 00:00:00 2001 From: syheliel <45957390+syheliel@users.noreply.github.com> Date: Sat, 17 Feb 2024 11:28:16 +0800 Subject: [PATCH 2/2] Update src/bin/lpython.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondřej Čertík --- src/bin/lpython.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lpython.cpp b/src/bin/lpython.cpp index 3a0fabb28b..d5afe1fb8c 100644 --- a/src/bin/lpython.cpp +++ b/src/bin/lpython.cpp @@ -1735,7 +1735,7 @@ int main(int argc, char *argv[]) // the first: std::string arg_file = arg_files[0]; if (CLI::NonexistentPath(arg_file).empty()){ - std::cerr << "Your input file doesn't exist. file name is: " << arg_file << std::endl; + std::cerr << "The input file does not exist: " << arg_file << std::endl; return 1; }