Skip to content

fix(C++): centralize ReadFileToTable error handling#866

Merged
yangxk1 merged 1 commit intoapache:mainfrom
SYaoJun:fix_error_handling
Feb 24, 2026
Merged

fix(C++): centralize ReadFileToTable error handling#866
yangxk1 merged 1 commit intoapache:mainfrom
SYaoJun:fix_error_handling

Conversation

@SYaoJun
Copy link
Copy Markdown
Contributor

@SYaoJun SYaoJun commented Feb 15, 2026

Reason for this PR

Currently, the ReadFileToTable has duplicated error handling in two conditions.
A better way is centralizing the check statements out of the if condition.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 15, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.22%. Comparing base (eab0fa5) to head (695abc2).
⚠️ Report is 28 commits behind head on main.

Files with missing lines Patch % Lines
cpp/src/graphar/filesystem.cc 66.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #866      +/-   ##
============================================
+ Coverage     80.21%   80.22%   +0.01%     
  Complexity      615      615              
============================================
  Files            93       93              
  Lines         10258    10254       -4     
  Branches       1050     1049       -1     
============================================
- Hits           8228     8226       -2     
+ Misses         1790     1788       -2     
  Partials        240      240              
Flag Coverage Δ
cpp 71.52% <66.66%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves code quality through refactoring and spelling corrections. The main change centralizes duplicated error handling in the ReadFileToTable function, while additional changes fix typos in example code comments.

Changes:

  • Refactored ReadFileToTable to eliminate duplicated error handling by declaring the status variable once and checking it after the conditional branches
  • Fixed spelling of "specified" (was "specificed") in mid-level reader example output messages
  • Fixed spelling of "construct" (was "constuct") and "first" (was "fisrt") in low-level reader example comments

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
cpp/src/graphar/filesystem.cc Centralized error handling by extracting duplicate status checks from if-else branches
cpp/examples/mid_level_reader_example.cc Fixed spelling of "specified" in console output messages and removed extra line break
cpp/examples/low_level_reader_example.cc Fixed spelling errors in comments ("construct" and "first")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yangxk1 yangxk1 merged commit 95ac39b into apache:main Feb 24, 2026
16 checks passed
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.

4 participants