lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.5k stars 158 forks source link

issue:2481 - Unhandled Exception on non-existent file #2642

Open juliazhorniakAMI opened 6 months ago

juliazhorniakAMI commented 6 months ago

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.

kmr-srbh commented 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.

Shaikh-Ubaid commented 5 months ago

@juliazhorniakAMI Thanks for this. Could you share which specific error/issue this change fixes? Sharing an example lpython code would be helpful.

Shaikh-Ubaid commented 5 months ago

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.

kmr-srbh commented 5 months ago

@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.