eza icon indicating copy to clipboard operation
eza copied to clipboard

fix: don't panic when printing to stdout/stderr fails

Open acuteenvy opened this issue 2 years ago • 2 comments

println!, eprintln! etc. all panic when printing to a standard stream fails.

$ eza --help > /dev/full
thread 'main' panicked at library/std/src/io/stdio.rs:1019:9:
failed printing to stdout: No space left on device (os error 28)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)
$ eza --nonexistent-option 2> /dev/full
Aborted (core dumped)

This PR makes eza ignore these errors instead.

acuteenvy avatar Dec 19 '23 15:12 acuteenvy

why changing this

writeln! is used everywhere else already, with proper error handling. Why println! in these few cases?

acuteenvy avatar Dec 19 '23 23:12 acuteenvy

You got a point there but not for the panic part as of right now and I dont think this 2 lines change is needed for the moment

MartinFillon avatar Dec 20 '23 16:12 MartinFillon