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

Preventing BrokenPipe error #97

Merged
merged 7 commits into from
Oct 26, 2021

Conversation

rlewicki
Copy link
Contributor

I solved this issue by replacing all print! and println! macros with the ones coming from calm_io library which are stdoutln! and stdout! macros. They are basically doing exactly same thing print*! except it actually returns a Result instead just panicking.

This allows us to catch the result of a text outputting attempt and check for an error. In this case we want to catch std::io::BrokenPipe error and continue in a graceful manner.

Let me know what do you think about using this library, is this fine or would you rather solve this in a different way?

This fixes issue #18

@alexhallam
Copy link
Owner

Thanks for this! #95 was a solution to the broken pipe error. issue #18 is more about avoiding the use of print*(). I think that stdout() is a possible option.

@UlazkaMateusz I wanted to ping you. I know that you wanted to provide a solution to this problem as well.

@rlewicki
Copy link
Contributor Author

Hey @alexhallam,

Does this PR need some updates/fixes or do you think its good to go?

Copy link
Owner

@alexhallam alexhallam left a comment

Choose a reason for hiding this comment

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

Looks good

@alexhallam
Copy link
Owner

Thanks for the ping I have not heard from @UlazkaMateusz so I will go ahead with the merge.

@alexhallam alexhallam merged commit f66e7e5 into alexhallam:main Oct 26, 2021
@rlewicki
Copy link
Contributor Author

Awesome, thanks!

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