Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/bin/lpython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1789,12 +1789,18 @@ int main(int argc, char *argv[])

// TODO: for now we ignore the other filenames, only handle
// the first:
std::string arg_file = arg_files[0];
if (CLI::NonexistentPath(arg_file).empty()){
std::cerr << "The input file does not exist: " << arg_file << std::endl;
return 1;
try {
std::string arg_file = arg_files[0];
if (CLI::NonexistentPath(arg_file).empty()) {
std::cerr << "Error: The input file does not exist: " << arg_file << std::endl;
return 1;
}
return 0;
}
catch (const std::exception& e) {
std::cerr << "Error: " << e.what() << std::endl;
return 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juliazhorniakAMI The change seems fine to me. Although I would like to see a test case that was failing before.

}

std::string outfile;
std::string basename;
basename = remove_extension(arg_file);
Expand Down