diff --git a/CHANGELOG.md b/CHANGELOG.md index 51fe7fa0..f3a30f45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ Bug fixes: * [BUG #1259](https://github.com/BurntSushi/ripgrep/issues/1259): Fix bug where the last byte of a `-f file` was stripped if it wasn't a `\n`. +* [BUG #1302](https://github.com/BurntSushi/ripgrep/issues/1302): + Show better error messages when a non-existent preprocessor command is given. 11.0.1 (2019-04-16) diff --git a/src/search.rs b/src/search.rs index 149f67c3..c866b4bf 100644 --- a/src/search.rs +++ b/src/search.rs @@ -396,7 +396,19 @@ impl SearchWorker { let mut cmd = Command::new(&bin); cmd.arg(path).stdin(Stdio::from(File::open(path)?)); - let rdr = self.command_builder.build(&mut cmd)?; + let rdr = self + .command_builder + .build(&mut cmd) + .map_err(|err| { + io::Error::new( + io::ErrorKind::Other, + format!( + "preprocessor command could not start: '{:?}': {}", + cmd, + err, + ), + ) + })?; self.search_reader(path, rdr).map_err(|err| { io::Error::new( io::ErrorKind::Other,