Skip to content

Throw exception when loading a nonexistent stream #379

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

Merged
merged 2 commits into from
Aug 20, 2024
Merged

Throw exception when loading a nonexistent stream #379

merged 2 commits into from
Aug 20, 2024

Conversation

sndth
Copy link
Contributor

@sndth sndth commented Aug 20, 2024

This PR fixes the issue with attempting to call a deserialization function on a nonexistent stream (std::ifstream), reported in issue #378.

Previously, when attempting to read data from a nonexistent stream, an infinite loop would occur, trying to read data that was not there.

Now, if the stream is empty, an exception will be thrown, which can be handled using a try-catch block.


Pull Request Checklist

Read the CONTRIBUTING.md file for detailed information.

  • Changes are described in the pull request or in a referenced issue.
  • The test suite compiles and runs without any error.
  • The code coverage on your branch is 100%.
  • The documentation is updated if you added/changed a feature.

Please don't

  • The C++11 support varies between different compilers and versions. Please note the list of supported compilers. Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with #ifdefs or other means.
  • Please refrain from proposing changes that would break YAML specifications. If you propose a conformant extension of YAML to be supported by the library, please motivate this extension.
  • Please do not open pull requests that address multiple issues.

@sndth sndth requested a review from fktn-k as a code owner August 20, 2024 07:11
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10466982060

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 10458362983: 0.0%
Covered Lines: 3973
Relevant Lines: 3973

💛 - Coveralls

Copy link
Owner

@fktn-k fktn-k left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!
The changes look good to me.

@fktn-k
Copy link
Owner

fktn-k commented Aug 20, 2024

@sndth
Although some CI jobs didn't pass successfully, that is not due to the changes introduced in this PR but some token accessibility issue in GA workflows. Just in case, I manually checked that the codebase is well formatted and properly amalgamated with no decrease in the coverage rate.

So I'll merge this PR. Thanks a lot!

@fktn-k fktn-k merged commit f67c433 into fktn-k:develop Aug 20, 2024
164 of 166 checks passed
@fktn-k fktn-k added this to the Release v0.3.11 milestone Aug 24, 2024
@fktn-k fktn-k added the bug Something isn't working label Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants