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

TableSlice::print_tty() should not panic on I/O errors #140

Open
koutheir opened this issue Mar 16, 2022 · 1 comment
Open

TableSlice::print_tty() should not panic on I/O errors #140

koutheir opened this issue Mar 16, 2022 · 1 comment
Labels

Comments

@koutheir
Copy link

Currently, TableSlice::print_tty() panics on I/O errors. I think it should return an error instead of panicking, because I/O errors are not exceptional situations. Panics are reserved to exceptional situations.

For example, failing to write to the standard output due to a broken pipe (EPIPE) is very common when commands are piped to head, tail, more, etc. The current behavior causes applications using this crate to panic when that happens, instead of simply exiting. See issue 16 in bingrep.

@pinkforest
Copy link
Collaborator

Will need to switch this to is-terminal as we did with clap since atty has soundness issues in Windows. Need to check this panic as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants