fix(C++): centralize ReadFileToTable error handling#866
Conversation
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
ReadFileToTableto 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.
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?