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

Handle file not found error #23

Merged
merged 2 commits into from
Sep 4, 2014
Merged

Handle file not found error #23

merged 2 commits into from
Sep 4, 2014

Conversation

pietbrauer
Copy link
Contributor

Generating coverage reports generated File not found errors for some classes without @interface or @implementation. This fixes it.

gcov_data ||=begin
gcov_file = File.new("./#{source_file_pathname.basename}.gcov")
gcov_file.read
rescue
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you rescue the specific exception? Or, better yet, check if File.exist? before reading it instead of letting the exception happen.

@pietbrauer
Copy link
Contributor Author

You were absolutely right, I fixed it.

@marklarr
Copy link
Contributor

marklarr commented Sep 4, 2014

Looks good! Thanks so much for this -- it's definitely something I had been meaning to do.

marklarr added a commit that referenced this pull request Sep 4, 2014
@marklarr marklarr merged commit 496c02b into SlatherOrg:master Sep 4, 2014
@pietbrauer pietbrauer deleted the fix_file_not_found branch October 27, 2014 07:28
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.

2 participants