Open juliazhorniakAMI opened 6 months ago
Hello @juliazhorniakAMI! Welcome to LPython.
We already have a mechanism for detecting non-existent input files and catching errors at runtime. Could you please be more specific regarding what the PR changes? I feel this might be redundant.
@juliazhorniakAMI Thanks for this. Could you share which specific error/issue this change fixes? Sharing an example lpython
code would be helpful.
Thanks for working on this @juliazhorniakAMI! I shared a query above. I am marking this as draft for now. Please mark "Ready for review" when ready.
@Shaikh-Ubaid , this PR was meant to be a fix for #2481, but that was fixed by #2536. The issue is open till now though.
This modification will print a specific error message ("Error: The input file does not exist") and exit with a return code of 1 if the input file doesn't exist. It catches any other exceptions thrown during the execution and prints their error message as well. Make sure to replace "your existing code here" with the relevant parts of your program.