Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

juliazhorniakAMI
Copy link

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
Copy link
Contributor

kmr-srbh commented Apr 5, 2024

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
Copy link
Collaborator

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

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

@Shaikh-Ubaid
Copy link
Collaborator

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 Shaikh-Ubaid marked this pull request as draft April 11, 2024 05:57
@kmr-srbh
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants