eza
eza copied to clipboard
fix: don't panic when printing to stdout/stderr fails
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.
why changing this
writeln! is used everywhere else already, with proper error handling. Why println! in these few cases?
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