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

Prevents filesystem exceptions #237

Merged
merged 1 commit into from
Jul 22, 2022
Merged

Conversation

CarlosNihelton
Copy link
Collaborator

Filesystem calls in the context this PR touches could fail due user making some configuration to the distro preventing Windows from accessing the referred file as well as user permissions, since the affected function is no longer called only during distro setup.

Thus, this PR avoids exceptions been thrown due filesystem API errors. std::bad_alloc can still be thrown :D

I preferred to go with the error_code API then the Pokémon approach (catch (...)).

@CarlosNihelton CarlosNihelton marked this pull request as ready for review July 22, 2022 11:31
Copy link
Collaborator

@EduardGomezEscandell EduardGomezEscandell left a comment

Choose a reason for hiding this comment

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

Never heard of it as "Pokemon approach" but I like it 😄

@CarlosNihelton CarlosNihelton merged commit 18a94ac into main Jul 22, 2022
@CarlosNihelton CarlosNihelton deleted the prevent-filesystem-exceptions branch July 22, 2022 13:15
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.

None yet

2 participants