-
Notifications
You must be signed in to change notification settings - Fork 42
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
Preventing BrokenPipe error #97
Conversation
Thanks for this! #95 was a solution to the broken pipe error. issue #18 is more about avoiding the use of @UlazkaMateusz I wanted to ping you. I know that you wanted to provide a solution to this problem as well. |
Hey @alexhallam, Does this PR need some updates/fixes or do you think its good to go? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Thanks for the ping I have not heard from @UlazkaMateusz so I will go ahead with the merge. |
Awesome, thanks! |
I solved this issue by replacing all
print!
andprintln!
macros with the ones coming fromcalm_io
library which arestdoutln!
andstdout!
macros. They are basically doing exactly same thingprint*!
except it actually returns aResult
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