File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
9
9
### Fixed
10
10
11
11
* CI: Use Powershell Compress-Archive to create Windows binary zip #424 - @cyqsimon
12
+ * Exit gracefully when there is a broken pipe error #429 - @sigmaSd
12
13
13
14
## [ 0.23.0] - 2024-08-17
14
15
Original file line number Diff line number Diff line change @@ -83,8 +83,14 @@ fn get_interface(interface_name: &str) -> Option<NetworkInterface> {
83
83
fn create_write_to_stdout ( ) -> Box < dyn FnMut ( String ) + Send > {
84
84
let mut stdout = io:: stdout ( ) ;
85
85
Box :: new ( {
86
- move |output : String | {
87
- writeln ! ( stdout, "{}" , output) . unwrap ( ) ;
86
+ move |output : String | match writeln ! ( stdout, "{}" , output) {
87
+ Ok ( _) => ( ) ,
88
+ Err ( e) if e. kind ( ) == ErrorKind :: BrokenPipe => {
89
+ // A process that was listening to bandwhich stdout has exited
90
+ // We can't do much here, lets just exit as well
91
+ std:: process:: exit ( 0 )
92
+ }
93
+ Err ( e) => panic ! ( "Failed to write to stdout: {e}" ) ,
88
94
}
89
95
} )
90
96
}
You can’t perform that action at this time.
0 commit comments